CI: Added semver for sdk package via CI/CD #20
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: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| verify: | |
| name: Lint, Typecheck, Test & Build | |
| runs-on: ubuntu-latest | |
| env: | |
| HAS_EXTENDED_TESTS: ${{ secrets.EXTENDED_REGRESSION_SSH_KEY != '' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| path: shotstack-studio-sdk | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| cache-dependency-path: shotstack-studio-sdk/pnpm-lock.yaml | |
| - name: Install dependencies | |
| working-directory: shotstack-studio-sdk | |
| run: pnpm install --frozen-lockfile | |
| - name: Run verification suite | |
| working-directory: shotstack-studio-sdk | |
| run: pnpm verify:ci | |
| - name: Upload coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: shotstack-studio-sdk/coverage/ | |
| retention-days: 14 | |
| - name: "[Extended] Set up SSH for regression suite" | |
| if: env.HAS_EXTENDED_TESTS == 'true' | |
| uses: webfactory/ssh-agent@v0.9.0 | |
| with: | |
| ssh-private-key: ${{ secrets.EXTENDED_REGRESSION_SSH_KEY }} | |
| - name: "[Extended] Clone regression suite" | |
| if: env.HAS_EXTENDED_TESTS == 'true' | |
| run: git clone git@github.com:shotstack/shotstack-studio-extended-regression-suite.git | |
| - name: "[Extended] Install test dependencies" | |
| if: env.HAS_EXTENDED_TESTS == 'true' | |
| working-directory: shotstack-studio-extended-regression-suite | |
| run: npm install | |
| - name: "[Extended] Run behavioural regression tests" | |
| if: env.HAS_EXTENDED_TESTS == 'true' | |
| working-directory: shotstack-studio-extended-regression-suite | |
| run: npm test | |
| - name: Dry run release | |
| working-directory: shotstack-studio-sdk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: pnpm exec semantic-release --dry-run |