Skip to content

ci: fix test job

ci: fix test job #103

Workflow file for this run

name: "Run tests"
on:
workflow_dispatch:
inputs:
pluginInterfaceRepoOwnerName:
description: "supertokens-plugin-interface repo owner name"
default: supertokens
required: true
pluginInterfaceBranchName:
description: "supertokens-plugin-interface repos branch name"
default: master
required: true
coreRepoOwnerName:
description: "supertokens-core repo owner name"
default: supertokens
required: true
coreBranchName:
description: "supertokens-core repo branch name"
default: master
required: true
workflow_call:
inputs:
pluginInterfaceRepoOwnerName:
required: true
type: string
pluginInterfaceBranchName:
required: true
type: string
coreRepoOwnerName:
required: true
type: string
coreBranchName:
required: true
type: string
jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
run: echo matrix={\"include\":$(bash test/listTestFiles.sh)}
- id: set-matrix
run: echo matrix={\"include\":$(bash test/listTestFiles.sh)} >> $GITHUB_OUTPUT
test_job:
name: Run tests
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.setup.outputs.matrix)}}
fail-fast: false
container: rishabhpoddar/supertokens_website_sdk_testing
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Environment variables
run: |
echo "Plugin Interface Owner: ${{ inputs.pluginInterfaceRepoOwnerName }}"
echo "Plugin Interface Branch: ${{ inputs.pluginInterfaceBranchName }}"
echo "Core Owner: ${{ inputs.coreRepoOwnerName }}"
echo "Core Branch: ${{ inputs.coreBranchName }}"
- name: Make git use https instead of ssh
run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/
- run: npm i --force
- name: Cloning supertokens-root
run: cd ../ && git clone https://github.com/supertokens/supertokens-root.git
- name: Update Java 1
run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
- name: Update Java 2
run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
- name: Modifying modules.txt in supertokens-root
run: cd ../supertokens-root && echo "core,${{ inputs.coreBranchName }},${{ inputs.coreRepoOwnerName }}\nplugin-interface,${{ inputs.pluginInterfaceBranchName }},${{ github.event.inputs.pluginInterfaceRepoOwnerName }}" > modules.txt
- name: Contents of modules.txt
run: cat ../supertokens-root/modules.txt
- name: Running loadModules in supertokens-root
run: cd ../supertokens-root && ./loadModules
- name: Changing permissions of supertokens-root
run: chmod -R 777 ../supertokens-root
- name: Setting up supertokens-root test environment
run: cd ../supertokens-root && bash ./utils/setupTestEnvLocal
- name: Run tests
run: INSTALL_PATH=../supertokens-root npm run test -- --ignore "./test/**/*.test.js" ${{ matrix.testPath }}