forked from dependabot/dependabot-core
-
Notifications
You must be signed in to change notification settings - Fork 0
206 lines (198 loc) · 6.93 KB
/
ci.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
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
name: CI
on:
push:
branches:
- "main"
pull_request:
paths-ignore:
- "CHANGELOG.md"
- "common/lib/dependabot/version.rb"
schedule:
- cron: "0 0 * * *"
jobs:
ci:
name: CI
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite:
- { path: bundler, name: bundler1, ci_node_total: 2, ci_node_index: 0 }
- { path: bundler, name: bundler1, ci_node_total: 2, ci_node_index: 1 }
- { path: bundler, name: bundler2, ci_node_total: 2, ci_node_index: 0 }
- { path: bundler, name: bundler2, ci_node_total: 2, ci_node_index: 1 }
- { path: cargo, name: cargo }
- { path: common, name: common }
- { path: composer, name: composer, ci_node_total: 2, ci_node_index: 0 }
- { path: composer, name: composer, ci_node_total: 2, ci_node_index: 1 }
- { path: docker, name: docker }
- { path: elm, name: elm }
- { path: git_submodules, name: git_submodules }
- { path: github_actions, name: github_actions }
- { path: go_modules, name: go_module, ci_node_total: 2, index: 0 }
- { path: go_modules, name: go_module, ci_node_total: 2, index: 1 }
- { path: gradle, name: gradle }
- { path: hex, name: hex, ci_node_total: 2, ci_node_index: 0 }
- { path: hex, name: hex, ci_node_total: 2, ci_node_index: 1 }
- { path: maven, name: maven }
- { path: npm_and_yarn, name: npm_and_yarn, ci_node_total: 3, ci_node_index: 0 }
- { path: npm_and_yarn, name: npm_and_yarn, ci_node_total: 3, ci_node_index: 1 }
- { path: npm_and_yarn, name: npm_and_yarn, ci_node_total: 3, ci_node_index: 2 }
- { path: nuget, name: nuget }
- { path: omnibus, name: omnibus }
- { path: python, name: python, ci_node_total: 5, ci_node_index: 0 }
- { path: python, name: python, ci_node_total: 5, ci_node_index: 1 }
- { path: python, name: python, ci_node_total: 5, ci_node_index: 2 }
- { path: python, name: python, ci_node_total: 5, ci_node_index: 3 }
- { path: python, name: python, ci_node_total: 5, ci_node_index: 4 }
- { path: python, name: python_slow, ci_node_total: 5, ci_node_index: 0 }
- { path: python, name: python_slow, ci_node_total: 5, ci_node_index: 1 }
- { path: python, name: python_slow, ci_node_total: 5, ci_node_index: 2 }
- { path: python, name: python_slow, ci_node_total: 5, ci_node_index: 3 }
- { path: python, name: python_slow, ci_node_total: 5, ci_node_index: 4 }
- { path: pub, name: pub, ci_node_total: 2, ci_node_index: 0 }
- { path: pub, name: pub, ci_node_total: 2, ci_node_index: 1 }
- { path: terraform, name: terraform }
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
bundler:
- Dockerfile
- 'common/**'
- 'bundler/**'
cargo:
- Dockerfile
- 'common/**'
- 'cargo/**'
common:
- Dockerfile
- 'common/**'
composer:
- Dockerfile
- 'common/**'
- 'composer/**'
docker:
- Dockerfile
- 'common/**'
- 'docker/**'
elm:
- Dockerfile
- 'common/**'
- 'elm/**'
git_submodules:
- Dockerfile
- 'common/**'
- 'git_submodules/**'
github_actions:
- Dockerfile
- 'common/**'
- 'github_actions/**'
go_modules:
- Dockerfile
- 'common/**'
- 'go_modules/**'
gradle:
- Dockerfile
- 'common/**'
- 'maven/**'
- 'gradle/**'
hex:
- Dockerfile
- 'common/**'
- 'hex/**'
maven:
- Dockerfile
- 'common/**'
- 'maven/**'
npm_and_yarn:
- Dockerfile
- 'common/**'
- 'npm_and_yarn/**'
nuget:
- Dockerfile
- 'common/**'
- 'nuget/**'
omnibus:
- Dockerfile
- 'common/**'
- 'omnibus/**'
pub:
- Dockerfile
- 'common/**'
- 'pub/**'
python:
- Dockerfile
- 'common/**'
- 'python/**'
terraform:
- Dockerfile
- 'common/**'
- 'terraform/**'
- name: Build dependabot-core image
if: steps.changes.outputs[matrix.suite.path] == 'true'
env:
DOCKER_BUILDKIT: 1
run: |
docker build \
-t "dependabot/dependabot-core:latest" \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--cache-from ghcr.io/dependabot/dependabot-core \
.
- name: Build dependabot-core-ci image
if: steps.changes.outputs[matrix.suite.path] == 'true'
env:
DOCKER_BUILDKIT: 1
run: |
docker build \
-f Dockerfile.ci \
-t "dependabot-core-ci:latest" \
--build-arg BUILDKIT_INLINE_CACHE=1 \
.
- name: Run ${{ matrix.suite.name }} tests
if: steps.changes.outputs[matrix.suite.path] == 'true'
run: |
docker run \
--env "CI=true" \
--env "RAISE_ON_WARNINGS=true" \
--env "DEPENDABOT_TEST_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" \
--env "SUITE_NAME=${{ matrix.suite.name }}" \
--env "CI_NODE_TOTAL=${{ matrix.suite.ci_node_total }}" \
--env "CI_NODE_INDEX=${{ matrix.suite.ci_node_index }}" \
--rm dependabot-core-ci bash -c \
"cd /home/dependabot/dependabot-core/${{ matrix.suite.path }} && ./script/ci-test"
updater:
name: Updater
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build dependabot-core image
env:
DOCKER_BUILDKIT: 1
run: |
docker build \
-t "dependabot/dependabot-core:latest" \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--cache-from ghcr.io/dependabot/dependabot-core \
.
- name: Build
run: script/build
- name: Lint
run: script/lint
env:
SKIP_BUILD: true
- name: Run updater tests
run: ./script/ci-test-updater
env:
SKIP_BUILD: true
DEPENDABOT_TEST_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: ./bin/lint