Skip to content

Commit e8bc7d4

Browse files
committed
add github actions ci tests
1 parent 7b8104f commit e8bc7d4

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/rust.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
test-latest:
10+
name: Test on latest Rust
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: "Rust Version"
14+
run: rustc --version
15+
16+
- name: "Checkout code"
17+
uses: actions/checkout@v4
18+
19+
- name: Setup
20+
run: |
21+
rustc --version
22+
apt-get update && apt-get install -y valgrind
23+
cargo install cargo-valgrind
24+
25+
- name: Run tests
26+
run: |
27+
cargo valgrind test
28+
cargo test
29+
30+
- name: Upload artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: target-latest
34+
path: target
35+
retention-days: 14
36+
37+
test-msrv:
38+
name: Test on Rust MSRV (1.63.0)
39+
runs-on: ubuntu-latest
40+
container:
41+
image: rust:1.63.0
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Setup
46+
run: |
47+
rustc --version
48+
apt-get update && apt-get install -y valgrind
49+
cargo install cargo-valgrind --version 2.0.0
50+
51+
- name: Run tests
52+
run: |
53+
cargo valgrind test
54+
cargo test
55+
56+
- name: Upload artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: target-msrv
60+
path: target
61+
retention-days: 14
62+
63+
Format:
64+
name: Format - nightly toolchain
65+
runs-on: ubuntu-latest
66+
strategy:
67+
fail-fast: false
68+
steps:
69+
- name: "Checkout repo"
70+
uses: actions/checkout@v4
71+
- name: "Select toolchain"
72+
uses: dtolnay/rust-toolchain@nightly
73+
- name: "Install rustfmt"
74+
run: rustup component add rustfmt
75+
- name: "Check formatting"
76+
run: cargo +nightly fmt --all -- --check

0 commit comments

Comments
 (0)