Skip to content

Commit

Permalink
ci/cd: update workflow to run unit tests
Browse files Browse the repository at this point in the history
Run unit tests on pushing to dev or main. Run upload test on pushing to
main only.
  • Loading branch information
wdzeng committed Sep 26, 2024
1 parent 4587111 commit e9057b6
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ jobs:
unittests:
name: Run unittests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: pnpm/action-setup@v3
with:
version: ^9.7.0
run_install: true
- run: pnpm unittest
upload-test:
name: Run upload test
needs: unittests
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -27,10 +42,12 @@ jobs:
TEST_ADDON_GUID: ${{ secrets.TEST_ADDON_GUID }}
TEST_JWT_ISSUER: ${{ secrets.TEST_JWT_ISSUER }}
TEST_JWT_SECRET: ${{ secrets.TEST_JWT_SECRET }}
run: pnpm test
run: pnpm test:upload
publish:
name: Publish action
needs: unittests
needs:
- unittests
- upload-test
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit e9057b6

Please sign in to comment.