Repository navigation
218 lines (194 loc) Β· 6.17 KB
/
Copy path_test_check.yml
File metadata and controls
218 lines (194 loc) Β· 6.17 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: Test make up and check the local dev setup
run-name: |
ref: ${{ github.ref_name }} |
version: ${{ inputs.version }} |
digest: ${{ inputs.digest }} |
permissions: {}
on:
workflow_call:
inputs:
version:
description: The version of the image to run
type: string
required: true
digest:
description: The build digest of the image to run. Overrides version.
type: string
required: false
workflow_dispatch:
inputs:
version:
description: The version of the image to run
type: string
required: true
digest:
description: The build digest of the image to run. Overrides version.
type: string
required: false
concurrency:
group: test_check-${{ github.workflow }}-${{ github.event_name}}-${{ github.ref}}-${{ toJson(inputs) }}
cancel-in-progress: true
jobs:
context:
runs-on: ubuntu-latest
outputs:
is_fork: ${{ steps.context.outputs.is_fork }}
steps:
- id: context
uses: mozilla/addons/.github/actions/context@c2dc2fd5862487f41add188a13243c2e71fdaa42 # 1.3
test_check:
runs-on: ubuntu-latest
name: |
version: '${{ matrix.version }}' |
target: '${{ matrix.target }}' |
deps: '${{ matrix.deps }}'
strategy:
fail-fast: false
matrix:
version:
- local
- ${{ inputs.version }}
target:
- development
- production
deps:
- development
- production
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: mozilla-l10n/addons-server-l10n
persist-credentials: false
path: locale
- name: ${{ matrix.version == 'local' && 'Uncached Build' || 'Pull' }} Check
id: build
continue-on-error: true
uses: ./.github/actions/run-docker
# Set environment variables that are expected to be ignored
env:
DOCKER_COMMIT: 'not-expected'
DOCKER_VERSION: 'not-expected'
with:
version: ${{ matrix.version }}
target: ${{ matrix.target }}
deps: ${{ matrix.deps }}
run: make check
- name: Verify build
id: verify
shell: bash
env:
version: ${{ matrix.version }}
target: ${{ matrix.target }}
outcome: ${{ steps.build.outcome }}
run: |
if [[ "$version" != "local" && "$target" == "development" && "$outcome" == "success" ]]; then
echo "Non local images must run in production mode"
exit 1
fi
- name: Cached Build Check
uses: ./.github/actions/run-docker
if: matrix.version == 'local' && steps.verify.outcome == 'success'
with:
version: ${{ matrix.version }}
target: ${{ matrix.target }}
deps: ${{ matrix.deps }}
run: echo true
test_make_docker_configuration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: mozilla-l10n/addons-server-l10n
persist-credentials: false
path: locale
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
package-manager-cache: false
- name: Install dependencies
shell: bash
run: npm ci
- name: Check make/docker configuration
shell: bash
run: |
docker compose version
make test_setup
- name: Test setup
uses: ./.github/actions/run-docker
with:
digest: ${{ inputs.digest }}
version: ${{ inputs.version }}
deps: development
run: |
pytest tests/make/
test_verify_failure:
runs-on: ubuntu-latest
needs: context
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: mozilla-l10n/addons-server-l10n
persist-credentials: false
path: locale
- name: Create failure
id: failure
continue-on-error: true
uses: ./.github/actions/run-docker
with:
digest: ${{ inputs.digest }}
version: ${{ inputs.version }}
run: |
exit 1
- name: Verify failure
if: always()
env:
outcome: ${{ steps.failure.outcome }}
run: |
if [[ "$outcome" != "failure" ]]; then
echo "Expected failure"
exit 1
fi
test_special_characters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: mozilla-l10n/addons-server-l10n
persist-credentials: false
path: locale
- name: Check (special characters in command)
uses: ./.github/actions/run-docker
with:
digest: ${{ inputs.digest }}
version: ${{ inputs.version }}
run: |
echo 'this is a question?'
echo 'a * is born'
echo 'wow an array []'
test_migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: mozilla-l10n/addons-server-l10n
persist-credentials: false
path: locale
- uses: ./.github/actions/run-docker
with:
version: ${{ inputs.version }}
run: echo true