-
Notifications
You must be signed in to change notification settings - Fork 11
92 lines (72 loc) · 2.4 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
name: Cargo Build & Test
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"
jobs:
build:
name: Zombienet SDK - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
# TODO 24-02-08: Disable nightly due to tkaitchuck/aHash#200.
#- nightly
steps:
# https://github.com/jlumbroso/free-disk-space
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
- uses: actions/checkout@v3
- name: Init nigthly install for fmt
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- name: Check format
run: cargo +nightly fmt --check --all
- name: Init install
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} && rustup component add clippy
- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "zombie-cache"
- name: Clippy
run: cargo clippy --all-targets --all-features
- name: Build
run: cargo build
- name: Tests
run: cargo test --workspace -- --skip ci_k8s
coverage:
name: Zombienet SDK - coverage
needs: build
runs-on: ubuntu-20.04
if: github.event_name == 'pull_request'
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v3
# https://github.com/jlumbroso/free-disk-space
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "zombie-cache"
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Collect coverage data
run: cargo llvm-cov nextest --workspace --exclude zombienet-sdk --test-threads 1 --lcov --output-path lcov.info
- name: Report code coverage
uses: Nef10/[email protected]
with:
lcov-file: lcov.info
pr-number: ${{ github.event.pull_request.number }}