forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 7
112 lines (103 loc) · 3.78 KB
/
Copy pathconformance-race.yaml
File metadata and controls
112 lines (103 loc) · 3.78 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Conformance Race Detection (ci-conformance-race)
# Any change in triggers needs to be reflected in the concurrency group.
on:
workflow_dispatch:
inputs:
PR-number:
description: "Pull request number."
required: true
context-ref:
description: "Context in which the workflow runs. If PR is from a fork, will be the PR target branch (general case). If PR is NOT from a fork, will be the PR branch itself (this allows committers to test changes to workflows directly from PRs)."
required: true
SHA:
description: "SHA under test (head of the PR branch)."
required: true
base-SHA:
description: "SHA of the base branch (target branch of the PR)."
required: false
extra-args:
description: "[JSON object] Arbitrary arguments passed from the trigger comment via regex capture group. Parse with 'fromJson(inputs.extra-args).argName' in workflow."
required: false
default: '{}'
# Run daily at midnight UTC
schedule:
- cron: '0 0 * * *'
# By specifying the access of one of the scopes, all of those that are not
# specified are set to 'none'.
permissions:
# To read actions state with cilium/workflow-telemetry-action
actions: read
# To be able to access the repository with actions/checkout
contents: read
# To allow retrieving information from the PR API
pull-requests: read
# To be able to set commit status
statuses: write
concurrency:
# Structure:
# - Parent concurrency group name to avoid deadlock with child workflows
# - Workflow name
# - Event type
# - A unique identifier depending on event type:
# - schedule: SHA
# - workflow_dispatch: PR number
#
# This structure ensures a unique concurrency group name is generated for each
# type of testing, such that re-runs will cancel the previous run.
group: |
parent
${{ github.workflow }}
${{ github.event_name }}
${{
(github.event_name == 'schedule' && github.sha) ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.PR-number)
}}
cancel-in-progress: true
jobs:
echo-inputs:
if: ${{ github.event_name == 'workflow_dispatch' }}
name: Echo Workflow Dispatch Inputs
runs-on: ubuntu-24.04
steps:
- name: Echo Workflow Dispatch Inputs
run: |
echo '${{ tojson(inputs) }}'
commit-status-start:
name: Commit Status Start
runs-on: ubuntu-24.04
steps:
- name: Set initial commit status
uses: cilium/cilium/.github/actions/set-commit-status@98995b41cfa4549131dadab2498f598c2a0c8d16 # main
with:
sha: ${{ inputs.SHA || github.sha }}
prepare-extra-args:
name: Prepare extra-args
runs-on: ubuntu-24.04
outputs:
extra-args: ${{ steps.merge.outputs.extra-args }}
steps:
- name: Merge extra-args with "detect-race"
id: merge
run: |
ARGS='${{ inputs.extra-args }}'
echo "extra-args=$(echo "${ARGS}" | jq -c '. + {"detect-race": true}')" >> "$GITHUB_OUTPUT"
conformance-ginkgo-race:
name: Conformance Ginkgo with Race Detection
needs: prepare-extra-args
uses: ./.github/workflows/conformance-ginkgo.yaml
secrets: inherit
with:
PR-number: ${{ inputs.PR-number || github.ref_name }}
context-ref: ${{ inputs.context-ref || github.sha }}
SHA: ${{ inputs.SHA || github.sha }}
extra-args: ${{ needs.prepare-extra-args.outputs.extra-args }}
merge-upload-and-status:
name: Merge Upload and Status
if: ${{ always() }}
needs: conformance-ginkgo-race
uses: ./.github/workflows/common-post-jobs.yaml
secrets: inherit
with:
context-ref: ${{ inputs.context-ref || github.sha }}
sha: ${{ inputs.SHA || github.sha }}
success: ${{ needs.conformance-ginkgo-race.result == 'success' }}