|
15 | 15 | name: Build Tests |
16 | 16 |
|
17 | 17 | on: |
18 | | - workflow_dispatch: |
19 | | - inputs: |
20 | | - tpu-type: |
21 | | - description: 'TPU Type' |
22 | | - required: true |
23 | | - default: 'v4-8' |
24 | | - type: choice |
25 | | - options: |
26 | | - - v4-8 |
27 | 18 | pull_request: # By default this runs for types assigned, opened and synchronize. |
28 | 19 |
|
| 20 | +permissions: |
| 21 | + contents: read |
| 22 | + |
29 | 23 | jobs: |
30 | | - set-variables: |
31 | | - runs-on: [ubuntu-22.04] |
32 | | - concurrency: |
33 | | - group: set-variables-${{ github.event.number}} |
34 | | - cancel-in-progress: true |
35 | | - outputs: |
36 | | - run-id: ${{steps.set-run-id.outputs.run-id}} |
37 | | - steps: |
38 | | - - name: set run-id |
39 | | - id: set-run-id |
40 | | - run: | |
41 | | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then |
42 | | - RUN_ID="dispatch" |
43 | | - elif [ "${{ github.ref }}" == "refs/heads/main" ]; then |
44 | | - RUN_ID="main" |
45 | | - else |
46 | | - RUN_ID="${{ github.event.number }}" |
47 | | - fi |
48 | | - echo run-id=$RUN_ID >> $GITHUB_OUTPUT |
49 | 24 | install-dependencies: |
50 | | - needs: [set-variables] |
51 | 25 | runs-on: ubuntu-22.04 |
52 | 26 | strategy: |
53 | 27 | matrix: |
@@ -85,23 +59,11 @@ jobs: |
85 | 59 | ${{env.pythonLocation}} |
86 | 60 | key: xpk-deps-${{ matrix.python-version }}-${{github.run_id}}-${{github.run_attempt}} |
87 | 61 | linter: |
88 | | - needs: [install-dependencies, set-variables] |
89 | | - concurrency: # We support one build or nightly test to run at a time currently. |
90 | | - group: linter-${{needs.set-variables.outputs.run-id}} |
91 | | - cancel-in-progress: true |
| 62 | + needs: [install-dependencies] |
92 | 63 | uses: ./.github/workflows/reusable_lint_and_format.yml |
93 | | - with: |
94 | | - run-id: '${{needs.set-variables.outputs.run-id}}' |
95 | 64 | verify-goldens: |
96 | | - needs: [install-dependencies, set-variables] |
| 65 | + needs: [install-dependencies] |
97 | 66 | uses: ./.github/workflows/reusable_goldens.yaml |
98 | | - with: |
99 | | - run-id: '${{needs.set-variables.outputs.run-id}}' |
100 | 67 | run-unit-tests: |
101 | | - needs: [install-dependencies, set-variables] |
| 68 | + needs: [install-dependencies] |
102 | 69 | uses: ./.github/workflows/reusable_unit_tests.yaml |
103 | | - with: |
104 | | - run-id: ${{needs.set-variables.outputs.run-id}} |
105 | | - concurrency: # We support one build or nightly test to run at a time currently. |
106 | | - group: unit-tests-${{needs.set-variables.outputs.run-id}} |
107 | | - cancel-in-progress: true |
0 commit comments