Update swc monorepo #758
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-ignore: | |
| - 'master' | |
| env: | |
| node-version: '22.x' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| precheck: | |
| name: Check jobs to run | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| affected-main: ${{ steps.affected.outputs.main }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| cache: yarn | |
| cache-dependency-path: '**/yarn.lock' | |
| - name: Install deps | |
| run: yarn install --prefer-offline | |
| - name: Check affected apps | |
| id: affected | |
| run: | | |
| main_affected=`./ops/bin/check-affected.sh app main origin/master` | |
| echo "::set-output name=main::$main_affected" | |
| main: | |
| name: Main app CI | |
| runs-on: ubuntu-24.04 | |
| needs: precheck | |
| if: ${{ needs.precheck.outputs.affected-main == 'true' }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| cache: yarn | |
| cache-dependency-path: '**/yarn.lock' | |
| - name: Install deps | |
| run: yarn install --prefer-offline | |
| - name: Codegen main-prisma | |
| run: yarn nx codegen main-prisma | |
| env: | |
| PRISMA_BINARY_TARGET: '["linux-musl"]' | |
| - name: Lint | |
| run: yarn nx lint main | |
| - name: Build | |
| run: yarn nx build main | |
| - name: Test - Unit | |
| run: yarn nx test main | |
| main-ci-e2e: | |
| name: Main app CI e2e | |
| runs-on: ubuntu-24.04 | |
| needs: precheck | |
| if: ${{ needs.precheck.outputs.affected-main == 'true' }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| - name: Test - e2e - Run | |
| uses: cypress-io/github-action@v5 | |
| timeout-minutes: 10 | |
| with: | |
| project: apps/main-e2e | |
| build: yarn nx up main-e2e | |
| start: yarn nx serve-e2e main # -c prod FIXME: -c prod is not working | |
| wait-on: http://localhost:3000 | |
| wait-on-timeout: 120 | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: cypress-screenshots | |
| path: cypress/screenshots | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: cypress-videos | |
| path: cypress/videos | |
| - name: Test - e2e - Teardown | |
| if: always() | |
| run: yarn nx down main-e2e |