-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (84 loc) · 2.81 KB
/
manifest-producer.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
name: manifest-producer
on:
push:
branches:
- main
- new-code # to be removed
pull_request:
branches:
- main
- new-code # to be removed
env:
GRCOV_VERSION: "0.8.20"
jobs:
################################## FORMAT LAYER #########################################
clippy-rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy, rustfmt
- name: Run rustfmt
run: cargo fmt --all -- --check --verbose
- name: Run cargo clippy
run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
################################## BACKEND LIGHT TESTS ##################################
backend-tests:
needs: [clippy-rustfmt]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install grcov
env:
GRCOV_LINK: https://github.com/mozilla/grcov/releases/download
GRCOV_BINARY: grcov-x86_64-unknown-linux-musl.tar.bz2
run: |
curl -L "$GRCOV_LINK/v$GRCOV_VERSION/$GRCOV_BINARY" |
tar xj -C $HOME/.cargo/bin
- name: Run Backend Integration Tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "backend-%p-%m.profraw"
run: cargo test --test light_tests -- --nocapture
- name: Run Backend Unit Tests
env:
RUSTGLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "digest-%p-%m.profraw"
run: cargo test --lib --features "progress_bar" -- --nocapture
- name: Get coverage data for codecov
run: |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch \
--ignore-not-existing --ignore "/*" --ignore "../*" \
--ignore "example/*" -o backend.info
- name: Upload Backend Coverage
uses: codecov/codecov-action@v4
with:
files: backend.info
token: ${{ secrets.CODECOV_TOKEN }}
################################## MULTI-PLATFORM TESTING JOB ###########################
multi-platform-build-test:
name: Build and Test on Multiple Platforms (Ubuntu, macOS, Windows)
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
needs: [backend-tests]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build the project
run: cargo build --workspace --all-features
- name: Generate docs
run: cargo doc --all-features --no-deps
- name: Run Docs Tests
run: cargo test --doc -- --nocapture