From 72aa4cde3fbbe5045d6d4139a027c9a12b268053 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 22 Feb 2025 19:59:07 -0500 Subject: [PATCH] chore: Selective test runner, fix bundle-size --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92acd7d6b9..ff2eb0afcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,8 +59,30 @@ jobs: - run: yarn install --frozen-lockfile - run: yarn tsc + changes: + runs-on: ubuntu-latest + outputs: + server: ${{ steps.filter.outputs.server }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + server: + - 'server/**' + - 'shared/**' + - 'package.json' + - 'yarn.lock' + app: + - 'app/**' + - 'shared/**' + - 'package.json' + - 'yarn.lock' + test: needs: build + if: ${{ needs.changes.outputs.app == 'true' }} runs-on: ubuntu-latest strategy: matrix: @@ -75,7 +97,8 @@ jobs: - run: yarn test:${{ matrix.test-group }} test-server: - needs: build + needs: [build, changes] + if: ${{ needs.changes.outputs.server == 'true' }} runs-on: ubuntu-latest services: postgres: @@ -121,6 +144,7 @@ jobs: bundle-size: needs: [build, types] + if: ${{ needs.changes.outputs.app == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -133,4 +157,7 @@ jobs: run: echo "NODE_ENV=production" >> $GITHUB_ENV - run: yarn vite:build - name: Send bundle stats to RelativeCI - run: npx relative-ci-agent + uses: relative-ci/agent-action@v2 + with: + key: ${{ secrets.RELATIVE_CI_KEY }} + token: ${{ secrets.GITHUB_TOKEN }}