-
Notifications
You must be signed in to change notification settings - Fork 17
57 lines (53 loc) · 1.29 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
name: CI
on:
push:
branches: [ main ]
pull_request:
types: [ opened, reopened, labeled, synchronize ]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
linter:
- golangci-lint
steps:
- uses: actions/checkout@v3
- name: Setup Nix
uses: ./.github/actions/setup-nix
- name: Run linter
run: nix run .#lint-${{ matrix.linter }}
build:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- nix-snapshotter
- image-hello
- image-redis
- image-redisWithShell
steps:
- uses: actions/checkout@v3
- name: Setup Nix
uses: ./.github/actions/setup-nix
- name: Build package
run: nix build .#${{ matrix.package }}
integration-test:
strategy:
matrix:
test:
- snapshotter
- kubernetes
runs-on: nix-snapshotter-runner
needs: [lint, build]
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test')
steps:
- uses: actions/checkout@v3
- name: Setup Nix
uses: ./.github/actions/setup-nix
with:
enable-kvm: true
- name: Build snapshotter
run: nix build
- name: Run integration tests
run: nix run -L .#test-${{ matrix.test }}