-
-
Notifications
You must be signed in to change notification settings - Fork 13
114 lines (108 loc) · 3.17 KB
/
verify.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
---
name: code verification
on: # yamllint disable-line rule:truthy
push:
branches:
- "master"
pull_request: {}
env:
CARGO_INCREMENTAL: 0
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
IN_CI: "true"
jobs:
skctl:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Check out repo and build scripts
uses: actions/checkout@v4
with:
submodules: recursive
- name: Run sccache
uses: mozilla-actions/[email protected]
- name: Build skctl
run: make skctl
- name: Check version
run: .build/skctl --version
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo and build scripts
uses: actions/checkout@v3
with:
submodules: recursive
- name: Run sccache
uses: mozilla-actions/[email protected]
- name: Build
run: make build
- name: Regenerate CRDs
run: .build/skctl crd > k8s/raw/simkube.io_simulations.yml
- name: Check CRDs are clean
uses: CatChen/check-git-status-action@v1
with:
fail-if-not-clean: true
lint:
runs-on: ubuntu-latest
steps:
- name: Check out repo and build scripts
uses: actions/checkout@v3
with:
submodules: recursive
- name: Run sccache
uses: mozilla-actions/[email protected]
- name: rustfmt nightly
run: |
rustup toolchain install nightly-x86_64-unknown-linux-gnu
rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install poetry
uses: snok/install-poetry@v1
# tomlq (included with yq) is needed to check the package version in Cargo.toml
- name: Install tomlq
run: pip install yq
- name: Run pre-commit
uses: pre-commit/[email protected]
test:
runs-on: ubuntu-latest
steps:
- name: Check out repo and build scripts
uses: actions/checkout@v3
with:
submodules: recursive
- name: Run sccache
uses: mozilla-actions/[email protected]
- name: Install grcov
run: |
curl -LO https://github.com/mozilla/grcov/releases/download/v0.8.18/grcov-x86_64-unknown-linux-gnu.tar.bz2
tar -xjf grcov-x86_64-unknown-linux-gnu.tar.bz2
mv grcov /usr/local/bin
- name: Add llvm-tools
run: rustup component add llvm-tools-preview
- name: Test
run: make test cover
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: rust-coverage
path: .build/coverage/rust-coverage.lcov
check-coverage:
runs-on: ubuntu-latest
needs:
- test
steps:
- name: Check out repo and build scripts
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download coverage
uses: actions/download-artifact@v4
- name: Check coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}