|
| 1 | +name: CI |
| 2 | +run-name: "${{ github.workflow }} (${{ github.ref_name }}): ${{ github.event.pull_request.title }}" |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [main] |
| 7 | + pull_request: |
| 8 | + branches: [main] |
| 9 | + types: [opened, synchronize, reopened, ready_for_review] |
| 10 | + |
| 11 | +defaults: |
| 12 | + run: |
| 13 | + shell: bash |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +# This workflow contains core CI jobs that run on push/pull_request events. |
| 20 | +# For additional jobs, create separate workflow_call files (e.g., call-*.yml) |
| 21 | +# and invoke them from this workflow. See .github/workflows/call-dependency-review.yml for reference. |
| 22 | +jobs: |
| 23 | + setup: |
| 24 | + name: Setup |
| 25 | + runs-on: ubuntu-latest |
| 26 | + timeout-minutes: 5 |
| 27 | + permissions: |
| 28 | + pull-requests: read |
| 29 | + if: ${{ !github.event.pull_request.draft }} |
| 30 | + outputs: |
| 31 | + dependencies: ${{ steps.filter.outputs.dependencies }} |
| 32 | + typescript: ${{ steps.filter.outputs.typescript }} |
| 33 | + steps: |
| 34 | + - name: Checkout Repository |
| 35 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 36 | + with: |
| 37 | + persist-credentials: false |
| 38 | + |
| 39 | + - name: Initialize |
| 40 | + uses: ./.github/actions/setup-environment |
| 41 | + |
| 42 | + - name: Check diff targets by path filters |
| 43 | + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 |
| 44 | + id: filter |
| 45 | + with: |
| 46 | + filters: | |
| 47 | + dependencies: |
| 48 | + - 'bun.lock' |
| 49 | + typescript: |
| 50 | + - 'bun.lock' |
| 51 | + - '**/tsconfig*.json' |
| 52 | + - '**/*.ts' |
| 53 | + - '**/*.tsx' |
| 54 | +
|
| 55 | + lint-format: |
| 56 | + needs: [setup] |
| 57 | + uses: ./.github/workflows/call-lint-format.yml |
| 58 | + |
| 59 | + type-check: |
| 60 | + needs: [setup] |
| 61 | + if: ${{ needs.setup.outputs.typescript == 'true' }} |
| 62 | + uses: ./.github/workflows/call-type-check.yml |
| 63 | + |
| 64 | + test: |
| 65 | + needs: [setup] |
| 66 | + uses: ./.github/workflows/call-test.yml |
| 67 | + secrets: |
| 68 | + CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" |
| 69 | + |
| 70 | + export-validation: |
| 71 | + needs: [setup, lint-format, type-check, test] |
| 72 | + if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') |
| 73 | + uses: ./.github/workflows/call-export-validation.yml |
| 74 | + |
| 75 | + status-check: |
| 76 | + name: Status Check |
| 77 | + runs-on: ubuntu-slim |
| 78 | + timeout-minutes: 1 |
| 79 | + needs: [setup, lint-format, type-check, test, export-validation] |
| 80 | + if: always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) |
| 81 | + steps: |
| 82 | + - run: exit 1 |
0 commit comments