Skip to content

ci/cd: upload CI to run unit tests and upload test #30

ci/cd: upload CI to run unit tests and upload test

ci/cd: upload CI to run unit tests and upload test #30

Workflow file for this run

name: CI
on:
push:
branches:
- main
- dev
workflow_dispatch:
jobs:
unit-test:
name: Run unit tests
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.12.0
run_install: true
- run: pnpm test:unit-test
upload-test:
name: Run upload test
needs: unit-test
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
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.12.0
run_install: true
- env:
TEST_API_KEY: ${{ secrets.TEST_API_KEY }}
TEST_CLIENT_ID: ${{ secrets.TEST_CLIENT_ID }}
TEST_PRODUCT_ID: ${{ secrets.TEST_PRODUCT_ID }}
run: pnpm test:upload
publish:
name: Publish action
needs:
- unit-test
- upload-test
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: wdzeng/action-of-action@v4