|
1 | 1 | name: CI |
2 | | -# Controls when the action will run. |
3 | 2 | on: |
4 | | - # Triggers the workflow on push or pull request events but only for the main branch |
5 | 3 | push: |
6 | 4 | branches: [main] |
7 | 5 | pull_request: |
8 | 6 | branches: [main] |
9 | | - # Allows you to run this workflow manually from the Actions tab |
10 | 7 | workflow_dispatch: |
11 | 8 | concurrency: |
12 | | - # Cancel previous actions from the same PR or branch except 'main' branch. |
13 | | - # See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info. |
14 | | - group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}} |
| 9 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
15 | 10 | cancel-in-progress: ${{ github.ref_name != 'main' }} |
16 | 11 | jobs: |
17 | 12 | test: |
18 | | - uses: bazel-contrib/.github/.github/workflows/bazel.yaml@v6 |
19 | | - with: |
20 | | - folders: | |
21 | | - [ |
22 | | - ".", |
23 | | - "e2e/smoke" |
24 | | - ] |
25 | | - exclude: | |
26 | | - [ |
27 | | - {"folder": ".", "bzlmodEnabled": false}, |
28 | | - {"folder": ".", "bazelVersion": "6.4.0"} |
29 | | - ] |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest, macos-latest] |
| 17 | + folder: |
| 18 | + - "." |
| 19 | + - "e2e/smoke" |
| 20 | + - "examples/simple" |
| 21 | + - "examples/aggregate" |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v5 |
| 25 | + - uses: bazel-contrib/setup-bazel@0.16.0 |
| 26 | + with: |
| 27 | + bazelisk-cache: true |
| 28 | + - name: Test ${{ matrix.folder }} |
| 29 | + working-directory: ${{ matrix.folder }} |
| 30 | + run: bazel test //... |
| 31 | + |
30 | 32 | pre-commit: |
31 | 33 | runs-on: ubuntu-latest |
32 | 34 | steps: |
33 | 35 | - uses: actions/checkout@v5 |
34 | 36 | - uses: pre-commit/action@v3.0.1 |
35 | | - # For branch protection settings, this job provides a "stable" name that can be used to gate PR merges |
36 | | - # on "all matrix jobs were successful". |
| 37 | + |
37 | 38 | conclusion: |
38 | 39 | needs: [test, pre-commit] |
39 | 40 | runs-on: ubuntu-latest |
40 | 41 | if: always() |
41 | 42 | steps: |
42 | 43 | - uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # v3.0.3 |
43 | | - # Note: possible conclusion values: |
44 | | - # https://github.com/technote-space/workflow-conclusion-action/blob/main/src/constant.ts |
45 | | - - name: report success |
| 44 | + - name: Report success |
46 | 45 | if: ${{ env.WORKFLOW_CONCLUSION == 'success' }} |
47 | | - working-directory: /tmp |
48 | | - run: echo ${{ env.WORKFLOW_CONCLUSION }} && exit 0 |
49 | | - - name: report failure |
| 46 | + run: exit 0 |
| 47 | + - name: Report failure |
50 | 48 | if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }} |
51 | | - working-directory: /tmp |
52 | | - run: echo ${{ env.WORKFLOW_CONCLUSION }} && exit 1 |
| 49 | + run: exit 1 |
0 commit comments