Version Packages (#1707) #654
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: | |
| push: | |
| branches: [main] | |
| jobs: | |
| what-changed: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.set-packages.outputs.packages }} | |
| permissions: | |
| contents: 'read' | |
| actions: 'read' | |
| pull-requests: 'read' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: nrwl/nx-set-shas@v4 | |
| id: setSHAs | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .tool-versions | |
| - run: yarn workspaces focus what-changed | |
| - uses: ./.github/actions/what-changed | |
| id: set-packages | |
| with: | |
| since: ${{ steps.setSHAs.outputs.base }} | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| .turbo | |
| packages/*/.cache | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .tool-versions | |
| - run: yarn | |
| - run: yarn typecheck | |
| - run: yarn lint --cache-strategy content | |
| - run: yarn format | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: [what-changed] | |
| if: ${{ needs.what-changed.outputs.packages != '[]' }} | |
| strategy: | |
| matrix: | |
| package: ${{ fromJSON(needs.what-changed.outputs.packages) }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| .turbo | |
| packages/*/.cache | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .tool-versions | |
| - run: yarn workspaces focus hono-middleware @hono/${{ matrix.package }} | |
| - run: yarn turbo --filter @hono/${{ matrix.package }} build | |
| - run: yarn test --coverage --project @hono/${{ matrix.package }} | |
| id: test | |
| if: ${{ matrix.package != 'eslint-config' && matrix.package != 'qwik-city' && matrix.package != 'react-compat' }} | |
| - uses: codecov/codecov-action@v5 | |
| if: ${{ matrix.package != 'eslint-config' && matrix.package != 'qwik-city' && matrix.package != 'react-compat' }} | |
| with: | |
| fail_ci_if_error: true | |
| directory: ./coverage | |
| flags: ${{ matrix.package }} |