-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.39 KB
/
cd.yml
File metadata and controls
57 lines (46 loc) · 1.39 KB
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
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Build & Test Statechart Library
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
rust: [ stable, beta, nightly ]
steps:
- name: Check out Source
uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- name: Cache Cargo Builds
uses: Swatinem/rust-cache@v2
- name: Run Clippy (lint)
env:
CI: 'True'
RUSTFLAGS: '-D warnings'
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run Tests
env:
CI: 'True'
RUSTFLAGS: '-D warnings'
run: cargo test --all-features
- name: Build Release
run: cargo build --release --all-features
- name: Build Docs
run: cargo doc --no-deps --release --all-features
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc