File tree 1 file changed +21
-2
lines changed
1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 38
38
- postgresql
39
39
- mysql
40
40
- mongodb
41
+ chunk : [0, 1, 2, 3, 4]
41
42
42
43
runs-on : ubuntu-latest
43
44
steps :
80
81
if : matrix.plugin != 'sqlite'
81
82
run : cd supertokens-root/supertokens-${{ matrix.plugin }}-plugin && ./startDb.sh
82
83
- name : Run OAuth Provider
83
- run : docker run -p 4444:4444 -p 4445:4445 -d --rm --name oauth-cicd rishabhpoddar/oauth-server-cicd && sleep 2
84
+ run : cd supertokens-root && docker run -p 4444:4444 -p 4445:4445 -d --rm --name oauth-cicd rishabhpoddar/oauth-server-cicd && sleep 2
85
+ - name : Discover test classes
86
+ id : discover
87
+ run : |
88
+ cd supertokens-root
89
+ TESTS=$(find . -path "*/src/test/**/*.java" | sed 's/.*src\/test\/java\///' | sed 's/\.java$//' | sed 's/\//./g')
90
+ echo "test_classes<<EOF" >> $GITHUB_OUTPUT
91
+ echo "$TESTS" >> $GITHUB_OUTPUT
92
+ echo "EOF" >> $GITHUB_OUTPUT
84
93
- name : Run tests
85
- run : cd supertokens-root && ./gradlew test
94
+ run : |
95
+ cd supertokens-root
96
+ TESTS="${{ steps.discover.outputs.test_classes }}"
97
+ TOTAL_TESTS=$(echo "$TESTS" | wc -l)
98
+ CHUNK_SIZE=$(( (TOTAL_TESTS + 4) / 5 ))
99
+ START=$(( ${{ matrix.chunk }} * CHUNK_SIZE + 1 ))
100
+ END=$(( START + CHUNK_SIZE - 1 ))
101
+ CHUNK_TESTS=$(echo "$TESTS" | sed -n "${START},${END}p" | tr '\n' ',' | sed 's/,$//')
102
+ if [ ! -z "$CHUNK_TESTS" ]; then
103
+ ./gradlew test --tests "${CHUNK_TESTS}"
104
+ fi
86
105
- name : Publish Test Report
87
106
uses : mikepenz/action-junit-report@v5
88
107
if : always()
You can’t perform that action at this time.
0 commit comments