-
Notifications
You must be signed in to change notification settings - Fork 2.5k
161 lines (150 loc) · 4.75 KB
/
Copy pathprivate.yaml
File metadata and controls
161 lines (150 loc) · 4.75 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
153
154
155
156
157
158
159
160
161
'env':
'BASE_IMAGE': |-
${{ vars.BASE_IMAGE || 'adguard/go-builder:1.26.8--1' }}
'CACHE_BUSTER': |-
${{ inputs.cache_buster || '0' }}
'CLIENT_DIR': |-
${{ inputs.client_dir || 'client_v2' }}
'FRONTEND_BASE_IMAGE': |-
${{ vars.FRONTEND_BASE_IMAGE || 'adguard/home-js-builder:4.0' }}
'jobs':
'TestFrontend':
'if': |
${{ github.repository_owner == 'AdGuardSoftwareLimited' }}
'permissions':
'contents': 'read'
'runs-on': 'team-go'
'steps':
- 'uses': 'actions/checkout@v6'
'with':
# Set to false to avoid GITHUB_TOKEN leaking.
#
# See https://github.com/actions/checkout/issues/485#issuecomment-934422611.
'persist-credentials': false
- 'name': 'Run frontend tests'
'run': |
#!/bin/sh
set -e -f -o pipefail -u -x
docker build \
--build-arg "BASE_IMAGE=${FRONTEND_BASE_IMAGE}" \
--build-arg "CACHE_BUSTER=${CACHE_BUSTER}" \
--build-arg "CLIENT_DIR=${CLIENT_DIR}" \
--progress 'plain' \
--target 'tester' \
-f ./docker/frontend.Dockerfile \
.
'LintAndTestJobDocker':
'if': |
${{ github.repository_owner == 'AdGuardSoftwareLimited' }}
'permissions':
'contents': 'read'
'runs-on': 'team-go'
'steps':
- 'uses': 'actions/checkout@v6'
'with':
# Set to false to avoid GITHUB_TOKEN leaking.
#
# See https://github.com/actions/checkout/issues/485#issuecomment-934422611.
'persist-credentials': false
- 'name': 'Lint and test step'
'run': |
#!/bin/sh
set -e -f -o pipefail -u -x
docker build \
--build-arg "BASE_IMAGE=${BASE_IMAGE}" \
--build-arg "CACHE_BUSTER=${CACHE_BUSTER}" \
--output '.' \
--progress 'plain' \
--target 'tester-exporter' \
-f ./docker/ci.Dockerfile \
.
exit_code="$(cat ./test-reports/test-exit-code.txt)"
readonly exit_code
exit "$exit_code"
'LintAndTestJobMacOS':
'if': |
${{ github.repository_owner == 'AdGuardSoftwareLimited' }}
'permissions':
'contents': 'read'
'runs-on':
- 'ephemeral'
- 'ephemeral-mac'
- '${{ vars.BUILD_IMAGE_VERSION_MACOS }}'
'steps':
- 'uses': 'actions/checkout@v6'
'with':
# Set to false to avoid GITHUB_TOKEN leaking.
#
# See https://github.com/actions/checkout/issues/485#issuecomment-934422611.
'persist-credentials': false
- 'name': 'Lint and test step'
'run': |
#!/bin/sh
set -e -f -o pipefail -u -x
# NOTE: Only run those checks that only need Go and Go tools.
make \
VERBOSE=1 \
go-deps \
go-os-check \
go-lint \
go-test \
go-bench \
go-fuzz \
;
'LintAndTestJobWindows':
'if': |
${{ github.repository_owner == 'AdGuardSoftwareLimited' }}
'permissions':
'contents': 'read'
'runs-on':
- 'ephemeral'
- 'ephemeral-vmwin'
- '${{ vars.BUILD_IMAGE_VERSION_WINDOWS_GO }}'
- 'ephemeral-limit-memory-8192'
- 'ephemeral-limit-cpu-4'
'steps':
- 'uses': 'actions/checkout@v6'
'with':
# Set to false to avoid GITHUB_TOKEN leaking.
#
# See https://github.com/actions/checkout/issues/485#issuecomment-934422611.
'persist-credentials': false
- 'name': 'Lint and test step'
'run': |
set -e -f -o pipefail -u -x
make \
VERBOSE=1 \
go-deps \
go-os-check \
go-lint \
;
# NOTE: Only run go-test with CGO_ENABLED for race test.
make \
VERBOSE=1 \
CGO_ENABLED=1 \
go-test \
;
make \
VERBOSE=1 \
go-bench \
go-fuzz \
;
'shell': 'bash'
'name': 'Lint and test workflow (private)'
'on':
'push':
'branches':
- '*'
'workflow_dispatch':
'inputs':
'cache_buster':
'default': ''
'description': |
Override to force re-run of cached stages (pass any unique value).
'type': 'string'
# Permissions are disabled for all the jobs by default, and then overridden for
# specific jobs if needed. This is a recommended practice for security reasons,
# and also allows to avoid mistakes with permissions when creating new jobs.
#
# See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions.
'permissions': {}