forked from martinthomson/ohttp
-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (89 loc) · 2.84 KB
/
check.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
name: CI
on:
push:
branches: ["main"]
paths-ignore: ["*.md", "LICENSE-*"]
pull_request:
branches: ["main"]
paths-ignore: ["*.md", "LICENSE-*"]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
check:
name: Continuous Integration
runs-on: ubuntu-latest
env:
NSS_DIR: ${{ github.workspace }}/nss
strategy:
fail-fast: false
matrix:
hpke:
- rust-hpke
rust:
- 1.75.0
- stable
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy, llvm-tools-preview
- name: Install Build Prerequisites for NSS
if: matrix.hpke == 'nss'
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \
build-essential \
ca-certificates \
clang \
coreutils \
curl \
git \
gyp \
libclang-dev \
libssl-dev \
lld \
llvm \
make \
mercurial \
ninja-build \
pkg-config \
ssh \
zlib1g-dev \
--no-install-recommends
echo RUSTFLAGS="-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
- name: Fetch NSS and NSPR
if: matrix.hpke == 'nss'
run: |
hg clone https://hg.mozilla.org/projects/nspr "$NSS_DIR"/../nspr
git clone --depth 1 https://github.com/nss-dev/nss "$NSS_DIR"
echo "LD_LIBRARY_PATH=${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_ENV"
- name: Build
run: |
cargo +${{ matrix.rust }} build --tests --no-default-features --features ${{ matrix.hpke }},client,server
- name: Run Tests
run: |
cargo +${{ matrix.rust }} test --no-default-features --features ${{ matrix.hpke }},client,server
- name: Check formatting
if: ${{ success() || failure() }}
run: |
cargo +${{ matrix.rust }} fmt --all -- --check --config imports_granularity=Crate
- name: Clippy
if: ${{ success() || failure() }}
run: |
cargo clippy --tests --no-default-features --features ${{ matrix.hpke }},client,server
- name: Install cargo-llvm-cov
if: matrix.rust == 'stable'
run: |
cargo install cargo-llvm-cov
- name: Generate coverage report
if: matrix.rust == 'stable'
run: |
cargo llvm-cov --features ${{ matrix.hpke }},client,server --cobertura --output-path target/cobertura.xml -- --test --test-threads=1
- name: Upload coverage artifact
if: matrix.rust == 'stable'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: target/cobertura.xml