-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (62 loc) · 1.79 KB
/
Copy pathci.yml
File metadata and controls
66 lines (62 loc) · 1.79 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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: go build ./...
- run: go test ./...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: gofmt
run: |
out="$(gofmt -l .)"
if [ -n "$out" ]; then
echo "These files are not gofmt-formatted:"; echo "$out"; exit 1
fi
- name: go vet
run: go vet ./...
- name: staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@v0.8.1
staticcheck ./...
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: oras-project/setup-oras@v1
- uses: anchore/sbom-action/download-syft@v0
- name: Install modctl (ModelPack CLI)
run: go install github.com/modelpack/modctl@v0.2.2
- name: Start zot registry
run: |
docker run -d --name zot -p 5000:5000 \
-v "$PWD/test/e2e/zot-config.json:/etc/zot/config.json:ro" \
ghcr.io/project-zot/zot-linux-amd64:latest
for i in $(seq 1 30); do
curl -sf http://localhost:5000/v2/ >/dev/null && break
sleep 1
done
curl -sf http://localhost:5000/v2/ >/dev/null || { docker logs zot; exit 1; }
- name: Run e2e tests
env:
MODEL_CLI_E2E_REGISTRY: localhost:5000
run: go test -tags e2e -v ./test/e2e/
- name: Registry logs
if: failure()
run: docker logs zot