diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8cedb7a39..004f6a73b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,10 +33,22 @@ on: required: true type: string jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v3 + - run: bash test/listTestsFiles.sh + - id: set-matrix + run: echo "::set-output name=matrix::{\"include\":$(bash test/findExamplesWithTests.sh)}" 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 @@ -72,4 +84,4 @@ jobs: - 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 + run: INSTALL_PATH=../supertokens-root npm run test -- --ignore "./test/**/*.test.js" ${{ matrix.testPath }} diff --git a/test/listTestFiles.sh b/test/listTestFiles.sh new file mode 100755 index 000000000..afc6f7b85 --- /dev/null +++ b/test/listTestFiles.sh @@ -0,0 +1,9 @@ +matrixEntries="" +delim="" +while IFS= read -r -d $'\0'; do + matrixEntries+=$delim"{\"testPath\": \""$(echo "$REPLY" )\""}"; # or however you want to process each file + delim=", " +done < <(find ./examples -name *.test.js -print0) + +matrixEntries="[$matrixEntries]" +echo $matrixEntries