-
Notifications
You must be signed in to change notification settings - Fork 235
250 lines (237 loc) · 7.53 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: CI
on:
merge_group:
pull_request:
branches:
- master
permissions: read-all
jobs:
linter-backend:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Install TensorFlow C library
run: |
FILENAME=libtensorflow-cpu-linux-x86_64-2.11.0.tar.gz
wget -q --no-check-certificate https://storage.googleapis.com/tensorflow/libtensorflow/${FILENAME}
sudo tar -C /usr/local -xzf ${FILENAME}
sudo ldconfig /usr/local/lib
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
args: --timeout 10m
linter-openapi:
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Lint OpenAPI specs
uses: github/super-linter@v7
env:
FILTER_REGEX_INCLUDE: docs/api/openapi.yaml
MULTI_STATUS: false
VALIDATE_ALL_CODEBASE: true
VALIDATE_OPENAPI: true
linter-artifacthub:
runs-on: ubuntu-20.04
container:
image: artifacthub/ah
options: --user root
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run ah lint
working-directory: ./charts/artifact-hub
run: ah lint
linter-clomonitor:
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
container:
image: public.ecr.aws/clomonitor/linter:latest
options: --user root
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run CloMonitor linter
run: clomonitor-linter --path . --url https://github.com/artifacthub/hub
tests-database:
runs-on: ubuntu-20.04
container:
image: artifacthub/db-tests
services:
postgres:
image: artifacthub/postgres
env:
POSTGRES_USER: tests
POSTGRES_PASSWORD: tests
POSTGRES_DB: tests
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Apply database migrations
working-directory: ./database/migrations
run: TERN_CONF=../../../.github/workflows/tern.conf PGPORT=${{ job.services.postgres.ports[5432] }} ./migrate.sh
- name: Install pgtap database extension
run: PGPASSWORD=tests psql -h postgres -p ${{ job.services.postgres.ports[5432] }} -U tests tests -c 'create extension pgtap;'
- name: Run database tests
working-directory: ./database/tests
run: PGPASSWORD=tests pg_prove --host postgres --dbname tests --username tests --verbose schema/*.sql functions/*/*.sql
tests-backend:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install TensorFlow C library
run: |
FILENAME=libtensorflow-cpu-linux-x86_64-2.11.0.tar.gz
wget -q --no-check-certificate https://storage.googleapis.com/tensorflow/libtensorflow/${FILENAME}
sudo tar -C /usr/local -xzf ${FILENAME}
sudo ldconfig /usr/local/lib
- name: Run backend tests
run: go test -cover -race -v -mod=readonly ./...
tests-frontend:
runs-on: ubuntu-20.04
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v4
with:
path: ./web/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
working-directory: ./web
run: yarn install
- name: Run prettier
working-directory: ./web
run: yarn format:diff
- name: Run eslint
working-directory: ./web
run: yarn lint
- name: Run frontend tests
working-directory: ./web
run: yarn test --watchAll=false --passWithNoTests --verbose --maxWorkers=4
tests-widget:
runs-on: ubuntu-20.04
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v4
with:
path: ./widget/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
working-directory: ./widget
run: yarn install
- name: Run prettier
working-directory: ./widget
run: yarn format:diff
- name: Run eslint
working-directory: ./widget
run: yarn lint
- name: Run widget tests
working-directory: ./widget
run: yarn test --watchAll=false --passWithNoTests --verbose --maxWorkers=4
build-backend:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install TensorFlow C library
run: |
FILENAME=libtensorflow-cpu-linux-x86_64-2.11.0.tar.gz
wget -q --no-check-certificate https://storage.googleapis.com/tensorflow/libtensorflow/${FILENAME}
sudo tar -C /usr/local -xzf ${FILENAME}
sudo ldconfig /usr/local/lib
- name: Build hub
working-directory: ./cmd/hub
run: go build -v
- name: Build scanner
working-directory: ./cmd/scanner
run: go build -v
- name: Build tracker
working-directory: ./cmd/tracker
run: go build -v
build-frontend:
runs-on: ubuntu-20.04
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v4
with:
path: ./web/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
working-directory: ./web
run: yarn install
- name: Build frontend
working-directory: ./web
run: yarn build
build-widget:
runs-on: ubuntu-20.04
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v4
with:
path: ./widget/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
working-directory: ./widget
run: yarn install
- name: Build widget
working-directory: ./widget
run: yarn build