-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (84 loc) · 3.18 KB
/
build.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
name: CI
on:
#schedule:
# - cron: '0 21 * * FRI'
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
ci:
name: ${{ matrix.os }}-${{ matrix.clang }}-${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
toolchain: [stable, beta, "stable minus 8 releases"]
clang: ["15"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install LLVM ${{ matrix.clang }}
id: llvm-installation
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.clang }}
echo "/usr/lib/llvm-${{ matrix.clang }}/bin" >> $GITHUB_PATH
echo "LIBCLANG_PATH=/usr/lib/llvm-${{ matrix.clang }}/lib" >> $GITHUB_ENV
echo "LLVM_CONFIG_PATH=/usr/lib/llvm-${{ matrix.clang }}/bin/llvm-config" >> $GITHUB_ENV
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: "clippy, rustfmt"
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Test (Debug)
run: |
cargo hack test --each-feature --workspace -- --nocapture
cargo hack test --feature-powerset --workspace -- --nocapture
- name: Test (Release)
run: |
cargo hack test --release --each-feature --workspace -- --nocapture
cargo hack test --release --feature-powerset --workspace -- --nocapture
- name: rust-clippy
run: |
cargo hack clippy --each-feature --all-targets --no-deps --workspace -- -D warnings
cargo hack clippy --feature-powerset --all-targets --no-deps --workspace -- -D warnings
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: "rustfmt"
- name: cargo-fmt
run: cargo fmt --all -- --check
- name: Generating documents
env:
RUSTDOCFLAGS: --cfg docsrs
run: cargo doc --no-deps
- name: Install cargo-llvm-cov
if: matrix.toolchain == 'stable'
uses: taiki-e/install-action@cargo-llvm-cov # needs rust 1.60+
- name: llvm-cov
if: matrix.toolchain == 'stable'
run: |
cargo llvm-cov --fail-under-lines 85 --workspace
- name: llvm-conv for Rust ${{ matrix.toolchain }}
if: matrix.toolchain == 'stable'
run: |
cargo llvm-cov --lcov --output-path lcov.info --workspace
- name: Upload coverage to Codecov for Rust ${{ matrix.toolchain }}
if: matrix.toolchain == 'stable'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: lcov.info
fail_ci_if_error: true