Skip to content

Commit 6be9b86

Browse files
committed
try unit test
1 parent b731e10 commit 6be9b86

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/unit-test.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Unit Tests"
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
push:
10+
branches:
11+
- master
12+
- "v[0-9]+.[0-9]+"
13+
- "ci/github-actions/unit-testing"
14+
tags:
15+
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"
16+
17+
jobs:
18+
define-versions:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
22+
cdiVersions: ${{ steps.versions.outputs.cdiVersions }}
23+
nodeVersions: '["18.20", "20.19", "22.14"]'
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: supertokens/get-supported-versions-action@main
27+
id: versions
28+
with:
29+
has-fdi: true
30+
has-cdi: true
31+
32+
test:
33+
runs-on: ubuntu-latest
34+
needs: define-versions
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
node-version: ${{ fromJSON(needs.define-versions.outputs.nodeVersions) }}
39+
cdi-version: ${{ fromJSON(needs.define-versions.outputs.cdiVersions) }}
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: supertokens/get-versions-action@main
43+
id: versions
44+
with:
45+
driver-name: node
46+
cdi-version: ${{ matrix.cdi-version }}
47+
env:
48+
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
49+
- uses: actions/setup-node@v5
50+
with:
51+
node-version: ${{ matrix.node-version }}
52+
- name: Install dependencies
53+
run: |
54+
npm install
55+
- name: Run unit tests
56+
run: |
57+
docker compose up --wait
58+
npm run test
59+
docker compose down
60+
env:
61+
SUPERTOKENS_CORE_VERSION: ${{ steps.versions.outputs.coreVersionXy }}

0 commit comments

Comments
 (0)