-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (76 loc) · 2.42 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
93
94
95
96
97
98
99
name: CI
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
# nightly build
schedule:
- cron: "0 0 * * *"
env:
# for now don't make the build fail on warnings
# RUSTFLAGS: "-D warnings"
# prevents out of disk space error
CARGO_INCREMENTAL: 0
CARGO_PROFILE_DEV_DEBUG: 0
# enable caching for faster compilation
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install mold linker
uses: rui314/setup-mold@v1
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov and nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov,nextest
- name: Check formatting
run: cargo fmt --check --all
- name: Check sources
run: cargo check --workspace --all-features
- name: Perform linting
run: cargo clippy --all-targets --all-features
- name: Run doctests
run: cargo test --doc --all-features --workspace
- name: Run tests
run: cargo llvm-cov --no-report nextest --all-features --workspace
- name: Combine coverage
run: cargo llvm-cov report --lcov --output-path coverage.lcov
# TODO: uncomment me once we are a public repo
# - name: Upload Coverage Report 📤
# uses: coverallsapp/[email protected]
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# file: ./coverage.lcov
nightly:
if: github.event.schedule == '0 0 * * *' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install mold linker
uses: rui314/setup-mold@v1
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Nightly build
run: cargo build -p preload-rs --all-features --release
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: preload-nightly
path: target/release/preload-rs