11name : " Unit Tests"
22
33on :
4- pull_request :
5- types :
6- - opened
7- - reopened
8- - synchronize
9- push :
10- branches :
11- - master
12- - " v[0-9]+.[0-9]+"
13- tags :
14- - " (dev-)?v[0-9]+.[0-9]+.[0-9]+"
4+ pull_request :
5+ types :
6+ - opened
7+ - reopened
8+ - synchronize
9+ - labeled
10+ - unlabeled
11+ push :
12+ branches :
13+ - " [0-9]+.[0-9]+"
14+
15+ # Only one instance of this workflow will run on the same ref (PR/Branch/Tag)
16+ # Previous runs will be cancelled.
17+ concurrency :
18+ group : ${{ github.workflow }}-${{ github.ref }}
19+ cancel-in-progress : true
1520
1621jobs :
17- define-versions :
18- runs-on : ubuntu-latest
19- outputs :
20- fdiVersions : ${{ steps.versions.outputs.fdiVersions }}
21- cdiVersions : ${{ steps.versions.outputs.cdiVersions }}
22- nodeVersions : ' ["18.20", "20.19", "22.14"]'
23- steps :
24- - uses : actions/checkout@v4
25- - uses : supertokens/get-supported-versions-action@main
26- id : versions
27- with :
28- has-fdi : true
29- has-cdi : true
22+ define-versions :
23+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests')
24+ runs-on : ubuntu-latest
25+ outputs :
26+ fdiVersions : ${{ steps.versions.outputs.fdiVersions }}
27+ cdiVersions : ${{ steps.versions.outputs.cdiVersions }}
28+ nodeVersions : ' ["18.20", "20.19", "22.14"]'
29+ steps :
30+ - uses : actions/checkout@v4
31+ - uses : supertokens/get-supported-versions-action@main
32+ id : versions
33+ with :
34+ has-fdi : true
35+ has-cdi : true
3036
31- test :
32- runs-on : ubuntu-latest
33- needs : define-versions
34- strategy :
35- fail-fast : false
36- matrix :
37- node-version : ${{ fromJSON(needs.define-versions.outputs.nodeVersions) }}
38- cdi-version : ${{ fromJSON(needs.define-versions.outputs.cdiVersions) }}
39- steps :
40- - uses : actions/checkout@v4
41- - uses : supertokens/get-versions-action@main
42- id : versions
43- with :
44- driver-name : node
45- cdi-version : ${{ matrix.cdi-version }}
46- env :
47- SUPERTOKENS_API_KEY : ${{ secrets.SUPERTOKENS_API_KEY }}
48- - uses : actions/setup-node@v4
49- with :
50- node-version : ${{ matrix.node-version }}
51- - name : Install dependencies
52- run : |
53- npm install
54- - name : Run unit tests
55- run : |
56- docker compose up --wait
57- npm run test
58- docker compose down
59- env :
60- SUPERTOKENS_CORE_VERSION : ${{ steps.versions.outputs.coreVersionXy }}
37+ test :
38+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests')
39+ runs-on : ubuntu-latest
40+ needs : define-versions
41+ strategy :
42+ fail-fast : false
43+ matrix :
44+ node-version : ${{ fromJSON(needs.define-versions.outputs.nodeVersions) }}
45+ cdi-version : ${{ fromJSON(needs.define-versions.outputs.cdiVersions) }}
46+ steps :
47+ - uses : actions/checkout@v4
48+ - uses : supertokens/get-versions-action@main
49+ id : versions
50+ with :
51+ driver-name : node
52+ cdi-version : ${{ matrix.cdi-version }}
53+ env :
54+ SUPERTOKENS_API_KEY : ${{ secrets.SUPERTOKENS_API_KEY }}
55+ - uses : actions/setup-node@v4
56+ with :
57+ node-version : ${{ matrix.node-version }}
58+ - name : Install dependencies
59+ run : |
60+ npm install
61+ - name : Run unit tests
62+ run : |
63+ docker compose up --wait
64+ npm run test
65+ docker compose down
66+ env :
67+ SUPERTOKENS_CORE_VERSION : ${{ steps.versions.outputs.coreVersionXy }}
0 commit comments