Add Blizzard API integration tests to help verify the API over time #259
Workflow file for this run
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 | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| env: | |
| # The node version to release with, generally the latest LTS | |
| release_node: 22.x | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| # Test against multiple node versions | |
| # Any currently maintained version, e.g. whether they are current, active or maintenance should be included | |
| node: [20.x, 22.x, 24.x, 25.x] | |
| name: Build, Test & Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@f2b2b233b538f500472c7274c7012f57857d8ce0 # https://github.com/pnpm/action-setup/commit/f2b2b233b538f500472c7274c7012f57857d8ce0 | |
| with: | |
| version: 10.28.0 | |
| - name: Cache turbo build setup | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ matrix.node }}-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo-${{ matrix.node }}- | |
| - name: Setup Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: 'pnpm' | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Turbo build | |
| run: pnpm build | |
| - name: Lint, Prettier, and Typecheck | |
| run: pnpm lint:ci | |
| - name: Test packages | |
| run: pnpm test | |
| env: | |
| VITE_BLIZZARD_CLIENT_ID: ${{ secrets.BLIZZARD_CLIENT_ID }} | |
| VITE_BLIZZARD_CLIENT_SECRET: ${{ secrets.BLIZZARD_CLIENT_SECRET }} | |
| # Only release with the version set in release_node and on a push to main | |
| - if: ${{ matrix.node == env.release_node && github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # Commit hash taken from https://github.com/changesets/action/tree/v1/src | |
| with: | |
| # This expects you to have a script called release which does a build for your packages and calls changeset publish | |
| publish: pnpm release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |