Agents.md #28
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: PR Check | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| - '!main' | |
| pull_request: | |
| branches: | |
| - '**' | |
| - '!main' | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| pr: | |
| name: PR Check | |
| runs-on: ubuntu-latest | |
| env: | |
| TURBO_CACHE_DIR: node_modules/.cache/turbo | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # https://github.com/changesets/changesets/issues/517#issuecomment-1239303017 | |
| - name: Setup Node.js 22 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| - if: ${{ github.event.pull_request.title != 'Version Packages' }} | |
| run: git pull --force --no-tags origin main:main | |
| - name: Install Dependencies | |
| run: yarn | |
| - name: Get yarn cache directory path | |
| id: yarn-cache-dir-path | |
| run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
| with: | |
| path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| #TODO https://turbo.build/repo/docs/guides/ci-vendors/github-actions#remote-caching | |
| - name: Cache turbo build setup | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - name: Lint | |
| run: yarn lint:all | |
| - name: Test | |
| run: yarn test | |
| # https://josh-ops.com/posts/github-code-coverage/ | |
| - name: Code Coverage Summary Report | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| with: | |
| filename: 'packages/*/coverage/cobertura-coverage.xml' | |
| badge: true | |
| format: 'markdown' | |
| output: 'both' | |
| - name: Add Coverage PR Comment | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| recreate: true | |
| path: code-coverage-results.md | |
| - name: Write to Job Summary | |
| run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY | |
| - name: Build | |
| run: yarn build | |
| # https://github.com/changesets/action?tab=readme-ov-file#without-publishing | |
| #- name: Create Release Pull Request | |
| # uses: changesets/action@v1 | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| #- name: Check Changesets | |
| # if: ${{ github.event.pull_request.title != 'Version Packages' }} | |
| # run: yarn changeset status --since=main |