|
| 1 | +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs |
| 3 | + |
| 4 | +name: Verify PR changes |
| 5 | + |
| 6 | +permissions: |
| 7 | + contents: read |
| 8 | + pull-requests: write |
| 9 | + |
| 10 | +on: |
| 11 | + pull_request: |
| 12 | + branches: ['main'] |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
| 21 | + node-version: [20.x, 22.x] |
| 22 | + package: [use-long-press, use-double-tap, react-interval-hook] |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + fetch-tags: 'true' |
| 29 | + fetch-depth: '0' |
| 30 | + |
| 31 | + - name: Enable Corepack |
| 32 | + run: corepack enable |
| 33 | + |
| 34 | + - name: Install Node.js v${{ matrix.node-version }} |
| 35 | + uses: actions/setup-node@v4 |
| 36 | + with: |
| 37 | + node-version: ${{ matrix.node-version }} |
| 38 | + registry-url: 'https://registry.npmjs.org/' |
| 39 | + cache: 'yarn' |
| 40 | + cache-dependency-path: 'yarn.lock' |
| 41 | + |
| 42 | + - name: Install dependencies |
| 43 | + run: yarn install --immutable |
| 44 | + |
| 45 | + - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies |
| 46 | + run: npm audit signatures |
| 47 | + |
| 48 | + - name: Lint all packages |
| 49 | + run: yarn lint |
| 50 | + |
| 51 | + - name: Type check all packages |
| 52 | + run: yarn typecheck |
| 53 | + |
| 54 | + - name: Test all packages with coverage |
| 55 | + run: yarn test:coverage |
| 56 | + |
| 57 | + - name: Report coverage for ${{ matrix.package }} |
| 58 | + uses: davelosert/vitest-coverage-report-action@4921c44721dd660c957e91843f00e1f837ab4375 |
| 59 | + with: |
| 60 | + name: ${{ matrix.package }} coverage report |
| 61 | + working-directory: packages/${{ matrix.package }} |
| 62 | + json-summary-path: ../../coverage/packages/${{ matrix.package }}/coverage-summary.json |
| 63 | + json-final-path: ../../coverage/packages/${{ matrix.package }}/coverage-final.json |
| 64 | + |
| 65 | + |
| 66 | +# - name: Upload use-long-press coverage reports to Codecov |
| 67 | +# uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 |
| 68 | +# with: |
| 69 | +# token: ${{ secrets.CODECOV_TOKEN }} |
| 70 | +# directory: ./coverage/packages/use-long-press |
| 71 | +# flags: hooks,use-long-press |
| 72 | +# |
| 73 | +# - name: Upload use-double-tap coverage reports to Codecov |
| 74 | +# uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 |
| 75 | +# with: |
| 76 | +# token: ${{ secrets.CODECOV_TOKEN }} |
| 77 | +# directory: ./coverage/packages/use-double-tap |
| 78 | +# flags: hooks,use-double-tap |
| 79 | +# |
| 80 | +# - name: Upload react-interval-hook coverage reports to Codecov |
| 81 | +# uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 |
| 82 | +# with: |
| 83 | +# token: ${{ secrets.CODECOV_TOKEN }} |
| 84 | +# directory: ./coverage/packages/react-interval-hook |
| 85 | +# flags: hooks,react-interval-hook |
0 commit comments