-
Notifications
You must be signed in to change notification settings - Fork 535
171 lines (158 loc) Β· 4.48 KB
/
_test_check.yml
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
name: Test make up and check the local dev setup
run-name: |
ref: ${{ github.ref_name }} |
version: ${{ inputs.version }} |
digest: ${{ inputs.digest }} |
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:
- uses: actions/checkout@v4
- id: context
uses: ./.github/actions/context
test_check:
runs-on: ubuntu-latest
name: |
version: '${{ matrix.version }}' |
target: '${{ matrix.target }}' |
mount: '${{ matrix.mount }}' |
deps: '${{ matrix.deps }}'
strategy:
fail-fast: false
matrix:
version:
- local
- ${{ inputs.version }}
target:
- development
- production
mount:
- development
- production
deps:
- development
- production
steps:
- uses: actions/checkout@v4
- shell: bash
continue-on-error: true
run: |
cat <<EOF
Values passed to the action:
version: ${{ matrix.version }}
target: ${{ matrix.target }}
mount: ${{ matrix.mount }}
deps: ${{ matrix.deps }}
EOF
- name: ${{ matrix.version == 'local' && 'Uncached Build' || 'Pull' }} Check
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 }}
mount: ${{ matrix.mount }}
deps: ${{ matrix.deps }}
run: make check
- name: Cached Build Check
uses: ./.github/actions/run-docker
if: ${{ matrix.version == 'local' }}
with:
version: ${{ matrix.version }}
target: ${{ matrix.target }}
mount: ${{ matrix.mount }}
deps: ${{ matrix.deps }}
run: echo true
test_make_docker_configuration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v2
- 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@v4
- name: Create failure
id: failure
continue-on-error: true
uses: ./.github/actions/run-docker
with:
digest: ${{ inputs.digest }}
version: ${{ inputs.version }}
logs: true
run: |
exit 1
- name: Verify failure
if: always()
run: |
if [[ "${{ steps.failure.outcome }}" != "failure" ]]; then
echo "Expected failure"
exit 1
fi
test_special_characters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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@v4
- uses: ./.github/actions/run-docker
with:
version: ${{ inputs.version }}
data_backup_skip: false
run: echo true