Skip to content

ci: unit-testing

ci: unit-testing #25

Workflow file for this run

name: "Unit Tests"
on:
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches:
- master
- "v[0-9]+.[0-9]+"
tags:
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"
jobs:
define-versions:
runs-on: ubuntu-latest
outputs:
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
cdiVersions: ${{ steps.versions.outputs.cdiVersions }}
nodeVersions: '["18.20", "20.19", "22.14"]'
steps:
- uses: actions/checkout@v4
- uses: supertokens/get-supported-versions-action@main
id: versions
with:
has-fdi: true
has-cdi: true
test:
runs-on: ubuntu-latest
needs: define-versions
strategy:
fail-fast: false
matrix:
node-version: ${{ fromJSON(needs.define-versions.outputs.nodeVersions) }}
cdi-version: ${{ fromJSON(needs.define-versions.outputs.cdiVersions) }}
steps:
- uses: actions/checkout@v4
- uses: supertokens/get-versions-action@main
id: versions
with:
driver-name: node
cdi-version: ${{ matrix.cdi-version }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm install
- name: Run unit tests
run: |
docker compose up --wait
npm run test
docker compose down
env:
SUPERTOKENS_CORE_VERSION: ${{ steps.versions.outputs.coreVersionXy }}