-
Notifications
You must be signed in to change notification settings - Fork 1.1k
77 lines (69 loc) · 2.47 KB
/
Copy pathtests_ci_ready.yml
File metadata and controls
77 lines (69 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# tests_ci_ready.yml
# Entry point for the standard test suite (Tier 1).
#
# - Triggered by 'ci:ready' label or synchronize events on PRs with 'ci:ready'.
# - ci:ready is "sticky" (persistent) for EVERYONE.
# - Runs fast/standard checks (CI, Hexagon, Xtensa Presubmit).
name: Tests (Standard)
on:
pull_request_target:
types:
- synchronize
- labeled
jobs:
gatekeeper:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check-condition.outputs.should_run }}
steps:
- name: check-condition
id: check-condition
run: |
RUN="false"
# Case 1: Just labeled 'ci:ready'
if [[ "${{ github.event.action }}" == "labeled" && "${{ github.event.label.name }}" == "ci:ready" ]]; then
RUN="true"
fi
# Case 2: Synchronize event AND 'ci:ready' is present
if [[ "${{ github.event.action }}" == "synchronize" && "${{ contains(github.event.pull_request.labels.*.name, 'ci:ready') }}" == "true" ]]; then
RUN="true"
fi
echo "should_run=$RUN" >> $GITHUB_OUTPUT
call-ci:
needs: gatekeeper
if: needs.gatekeeper.outputs.should_run == 'true'
uses: ./.github/workflows/ci.yml
with:
trigger-sha: ${{ github.event.pull_request.head.sha }}
call-hexagon:
needs: gatekeeper
if: needs.gatekeeper.outputs.should_run == 'true'
uses: ./.github/workflows/hexagon.yml
with:
trigger-sha: ${{ github.event.pull_request.head.sha }}
secrets:
tflm-bot-token: ${{ secrets.TFLM_BOT_PACKAGE_READ_TOKEN }}
call-xtensa-presubmit:
needs: gatekeeper
if: needs.gatekeeper.outputs.should_run == 'true'
uses: ./.github/workflows/xtensa_presubmit.yml
with:
trigger-sha: ${{ github.event.pull_request.head.sha }}
secrets:
tflm-bot-token: ${{ secrets.TFLM_BOT_PACKAGE_READ_TOKEN }}
call-check-tflite-files:
needs: gatekeeper
if: needs.gatekeeper.outputs.should_run == 'true'
uses: ./.github/workflows/check_tflite_files.yml
with:
trigger-sha: ${{ github.event.pull_request.head.sha }}
pr-number: ${{ github.event.pull_request.number }}
pr-body: ${{ github.event.pull_request.body }}
secrets:
tflm-bot-token: ${{ secrets.TFLM_BOT_PACKAGE_READ_TOKEN }}
tests-passed:
needs: [gatekeeper, call-ci, call-hexagon, call-xtensa-presubmit, call-check-tflite-files]
if: needs.gatekeeper.outputs.should_run == 'true'
runs-on: ubuntu-latest
steps:
- run: exit 0