-
Notifications
You must be signed in to change notification settings - Fork 17
96 lines (74 loc) · 2.23 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
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *' # Monthly
jobs:
build:
strategy:
fail-fast: false
matrix:
rust: [stable, beta]
features: ['', dlopen]
name: ${{ matrix.rust }} - ${{ matrix.features }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install Rust
run: |
rustup set auto-self-update check-only
rustup toolchain install ${{ matrix.rust }} --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --all --features=${{ matrix.features }}
- name: Set up XDG_RUNTIME_DIR
run: |
mkdir .runtime
echo "XDG_RUNTIME_DIR=$PWD/.runtime" >> $GITHUB_ENV
- name: Test
run: cargo test --all --features=${{ matrix.features }}
- name: Generate documentation
run: cargo doc --features=${{ matrix.features }}
- name: Copy documentation index
run: cp doc/index.html target/doc/
- name: Deploy documentation
if: >
matrix.rust == 'stable' &&
matrix.features == '' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
clippy:
name: clippy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install Rust
run: |
rustup set auto-self-update check-only
rustup toolchain install stable --profile minimal --component clippy
- uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --all --all-targets
rustfmt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install Rust
run: |
rustup set auto-self-update check-only
rustup toolchain install nightly --profile minimal --component rustfmt
rustup override set nightly
- name: Run rustfmt
run: cargo fmt --all -- --check