Repository navigation
152 lines (142 loc) · 4.84 KB
/
Copy pathpackage-regression.yml
File metadata and controls
152 lines (142 loc) · 4.84 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Package Regression
on:
workflow_call:
inputs:
source-sha:
description: Immutable candidate commit.
required: true
type: string
secrets:
DC_GITHUB_CLIENT_ID:
required: false
DC_GITHUB_CLIENT_SECRET:
required: false
DC_GITHUB_REDIRECT_URI:
required: false
workflow_dispatch: {}
schedule:
- cron: '37 18 * * *'
permissions:
contents: read
jobs:
package-windows:
name: regression-windows(${{ matrix.arch }})
permissions:
contents: read
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
uses: ./.github/workflows/_package-windows.yml
with:
source-sha: ${{ inputs.source-sha || github.sha }}
arch: ${{ matrix.arch }}
artifact-purpose: verification
enforce-installer-size: true
secrets:
DC_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
DC_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
DC_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
package-linux:
name: regression-linux(${{ matrix.arch }})
permissions:
contents: read
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
uses: ./.github/workflows/_package-linux.yml
with:
source-sha: ${{ inputs.source-sha || github.sha }}
arch: ${{ matrix.arch }}
artifact-purpose: verification
enforce-installer-size: true
secrets:
DC_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
DC_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
DC_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
package-macos:
name: regression-macos(${{ matrix.arch }})
permissions:
contents: read
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
uses: ./.github/workflows/_package-macos.yml
with:
source-sha: ${{ inputs.source-sha || github.sha }}
arch: ${{ matrix.arch }}
artifact-purpose: verification
enforce-installer-size: true
secrets:
DC_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
DC_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
DC_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
scheduled-status:
name: scheduled-regression-status
if: ${{ always() && github.event_name == 'schedule' }}
concurrency:
group: scheduled-package-regression-issue
queue: max
needs:
- package-windows
- package-linux
- package-macos
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
issues: write
steps:
- name: Update scheduled package regression issue
shell: bash
env:
GH_TOKEN: ${{ github.token }}
ISSUE_TITLE: '[CI] Scheduled package regression is failing'
WINDOWS_RESULT: ${{ needs.package-windows.result }}
LINUX_RESULT: ${{ needs.package-linux.result }}
MACOS_RESULT: ${{ needs.package-macos.result }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
set -euo pipefail
open_issue_numbers="$(
gh issue list \
--repo "${GITHUB_REPOSITORY}" \
--state open \
--search "\"${ISSUE_TITLE}\" in:title" \
--limit 100 \
--json number,title \
--jq '.[] | select(.title == env.ISSUE_TITLE) | .number'
)"
issue_number="${open_issue_numbers%%$'\n'*}"
if [[ "${WINDOWS_RESULT}" == 'success' &&
"${LINUX_RESULT}" == 'success' &&
"${MACOS_RESULT}" == 'success' ]]; then
if [[ -n "${issue_number}" ]]; then
gh issue close "${issue_number}" \
--repo "${GITHUB_REPOSITORY}" \
--reason completed \
--comment "Recovered in [run #${GITHUB_RUN_NUMBER}](${RUN_URL})."
fi
exit 0
fi
body_path="${RUNNER_TEMP}/package-regression-status.md"
{
printf 'The scheduled package regression did not complete successfully.\n\n'
printf -- '- Run: [#%s](%s)\n' "${GITHUB_RUN_NUMBER}" "${RUN_URL}"
printf -- '- Commit: `%s`\n' "${GITHUB_SHA}"
printf -- '- Windows: `%s`\n' "${WINDOWS_RESULT}"
printf -- '- Linux: `%s`\n' "${LINUX_RESULT}"
printf -- '- macOS: `%s`\n' "${MACOS_RESULT}"
} > "${body_path}"
if [[ -n "${issue_number}" ]]; then
gh issue comment "${issue_number}" \
--repo "${GITHUB_REPOSITORY}" \
--body-file "${body_path}"
else
gh issue create \
--repo "${GITHUB_REPOSITORY}" \
--title "${ISSUE_TITLE}" \
--body-file "${body_path}"
fi