fix: workflow condition #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Checks for release | |
on: | |
push: | |
branches: | |
- '[0-9]+.[0-9]+' | |
tags: | |
- 'dev-*' | |
jobs: | |
dependency-versions: | |
name: Dependency Versions | |
runs-on: ubuntu-latest | |
outputs: | |
versions: ${{ steps.result.outputs.versions }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: supertokens/get-core-dependencies-action@main | |
with: | |
run-for: PR | |
id: result | |
unit-tests: | |
name: Run unit tests | |
uses: ./.github/workflows/unit-test.yml | |
wait-for-docker: | |
name: Wait for Docker | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.set_tag.outputs.TAG }} | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Wait for Docker build | |
env: | |
SHA: ${{ github.sha }} | |
run: | | |
python .github/helper/wait-for-docker.py | |
- name: set tag | |
id: set_tag | |
run: | | |
echo "TAG=${GITHUB_REF}" | sed 's/refs\/heads\///g' | sed 's/\//_/g' >> $GITHUB_OUTPUT | |
stress-tests: | |
needs: [wait-for-docker] | |
uses: ./.github/workflows/stress-tests.yml | |
with: | |
tag: ${{ needs.wait-for-docker.outputs.tag }} | |
mark-as-passed: | |
needs: [dependency-versions, unit-tests, stress-tests] | |
name: Mark as passed | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
plugin: | |
- sqlite | |
- postgresql | |
# no longer supported | |
# - mysql | |
# - mongodb | |
steps: | |
- name: Mark plugin as passed | |
if: matrix.plugin != 'sqlite' && needs.dependency-versions.outputs.versions[matrix.plugin] != '' | |
uses: muhfaris/request-action@main | |
with: | |
url: https://api.supertokens.io/0/plugin | |
method: PATCH | |
headers: | | |
{ | |
"Content-Type": "application/json", | |
"api-version": "0" | |
} | |
body: | | |
{ | |
"password": "${{ secrets.SUPERTOKENS_API_KEY }}", | |
"version": "${{ needs.dependency-versions.outputs.versions[matrix.plugin] }}", | |
"planType": "FREE", | |
"name": "${{ matrix.plugin }}", | |
"testPassed": true | |
} | |
- name: Mark core as passed | |
if: matrix.plugin == 'sqlite' && needs.dependency-versions.outputs.versions['core'] != '' | |
uses: muhfaris/request-action@main | |
with: | |
url: https://api.supertokens.io/0/core | |
method: PATCH | |
headers: | | |
{ | |
"Content-Type": "application/json", | |
"api-version": "0" | |
} | |
body: | | |
{ | |
"password": "${{ secrets.SUPERTOKENS_API_KEY }}", | |
"version": "${{ needs.dependency-versions.outputs.versions['core'] }}", | |
"planType": "FREE", | |
"testPassed": true | |
} |