Skip to content

Commit c413394

Browse files
committed
chore(ci): test against multiple platforms
chore: update README, docs fix: non-Unix platforms build chore: release v0.3.1
1 parent 2da0d39 commit c413394

14 files changed

Lines changed: 960 additions & 227 deletions

File tree

.github/workflows/ci.yml

Lines changed: 84 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,99 @@
1-
name: CI Test
1+
name: CI
22

33
on:
44
push:
5-
paths: [ "src/**", "Cargo.toml"]
6-
workflow_dispatch: {}
5+
branches: ["main"]
6+
paths:
7+
- "src/**"
8+
- "Cargo.toml"
9+
- "Cargo.lock"
10+
- ".github/workflows/ci.yml"
11+
pull_request:
12+
paths:
13+
- "src/**"
14+
- "Cargo.toml"
15+
- "Cargo.lock"
16+
- ".github/workflows/ci.yml"
17+
merge_group:
18+
paths:
19+
- "src/**"
20+
- "Cargo.toml"
21+
- "Cargo.lock"
22+
- ".github/workflows/ci.yml"
23+
workflow_dispatch:
24+
25+
permissions:
26+
contents: read
727

828
env:
29+
RUSTFLAGS: -Dwarnings
30+
RUST_BACKTRACE: full
931
CARGO_TERM_COLOR: always
1032

1133
jobs:
1234
test:
13-
name: Build & Test
35+
name: Test (Rust ${{matrix.toolchain}}, ${{matrix.os}}, target ${{matrix.target}})
36+
runs-on: ${{matrix.os}}
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
toolchain: ["nightly", "beta", "stable", "1.83.0"]
41+
os: [ubuntu-latest, windows-latest, macos-latest]
42+
include:
43+
- os: ubuntu-latest
44+
target: x86_64-unknown-linux-gnu
45+
- os: windows-latest
46+
target: x86_64-pc-windows-msvc
47+
- os: macos-latest
48+
target: aarch64-apple-darwin
49+
timeout-minutes: 45
50+
steps:
51+
- uses: actions/checkout@v4
52+
with:
53+
persist-credentials: false
54+
- uses: dtolnay/rust-toolchain@master
55+
with:
56+
toolchain: ${{matrix.toolchain}}
57+
components: llvm-tools, clippy, rust-src
58+
- uses: taiki-e/install-action@v2
59+
with:
60+
tool: just,cargo-llvm-cov,cargo-nextest
61+
- name: Enable type layout randomization
62+
if: matrix.toolchain == 'nightly'
63+
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
64+
- run: sudo apt-get update && sudo apt-get install -y musl-tools
65+
if: endsWith(matrix.target, 'musl')
66+
- run: rustup target add ${{matrix.target}}
67+
- run: just ci-test --target ${{matrix.target}}
68+
69+
docs:
70+
name: Documentation
71+
runs-on: ubuntu-latest
72+
timeout-minutes: 45
73+
env:
74+
RUSTDOCFLAGS: -Dwarnings
75+
steps:
76+
- uses: actions/checkout@v4
77+
with:
78+
persist-credentials: false
79+
- uses: dtolnay/rust-toolchain@nightly
80+
- uses: dtolnay/install@cargo-docs-rs
81+
- run: cargo docs-rs
82+
83+
clippy:
84+
name: Clippy
1485
runs-on: ubuntu-latest
86+
if: github.event_name != 'pull_request'
87+
timeout-minutes: 45
1588
steps:
16-
- name: Checkout repository
17-
uses: actions/checkout@v4
89+
- uses: actions/checkout@v4
1890
with:
1991
persist-credentials: false
20-
- name: Read MSRV from Cargo.toml
21-
id: msrv
22-
run: |
23-
echo "MSRV=$(grep '^rust-version = ' Cargo.toml | cut -d'"' -f2)" >> $GITHUB_ENV
24-
- name: Setup Rust toolchain to MSRV
25-
uses: actions-rust-lang/setup-rust-toolchain@v1
92+
- uses: dtolnay/rust-toolchain@master
2693
with:
27-
toolchain: ${{ env.MSRV }}
28-
- name: Build
29-
run: cargo build --verbose
30-
# criterion breaks MSRV
31-
- name: Setup Rust toolchain to latest stable
32-
uses: actions-rust-lang/setup-rust-toolchain@v1
94+
toolchain: 1.83.0
95+
components: clippy
96+
- uses: taiki-e/install-action@v2
3397
with:
34-
toolchain: stable
35-
- name: Test
36-
run: cargo test --verbose
37-
env:
38-
RUST_BACKTRACE: 1
98+
tool: just
99+
- run: just clippy --all

.gitignore

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1 @@
1-
# Generated by Cargo
2-
# will have compiled files and executables
3-
/target/
4-
5-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
6-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
7-
Cargo.lock
8-
9-
# These are backup files generated by rustfmt
10-
**/*.rs.bk
11-
12-
13-
#Added by cargo
14-
#
15-
#already existing elements are commented out
16-
171
/target
18-
#**/*.rs.bk
19-
#Cargo.lock
20-
21-
.idea/

0 commit comments

Comments
 (0)