Skip to content

Commit b74457c

Browse files
committed
Merge branch 'main' into codegen-bot/fix-failing-tests-design-philosophy
Signed-off-by: Adam Poulemanos <[email protected]>
2 parents 37cd455 + a5e8af3 commit b74457c

File tree

9 files changed

+461
-9
lines changed

9 files changed

+461
-9
lines changed

.github/workflows/ci.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test Suite
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
rust:
19+
- stable
20+
- beta
21+
- nightly
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
submodules: recursive
26+
27+
- name: Install Rust
28+
uses: dtolnay/rust-toolchain@master
29+
with:
30+
toolchain: ${{ matrix.rust }}
31+
components: rustfmt, clippy
32+
33+
- name: Cache cargo registry
34+
uses: actions/cache@v4
35+
with:
36+
path: ~/.cargo/registry
37+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
38+
39+
- name: Cache cargo index
40+
uses: actions/cache@v4
41+
with:
42+
path: ~/.cargo/git
43+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
44+
45+
- name: Cache cargo build
46+
uses: actions/cache@v4
47+
with:
48+
path: target
49+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
50+
51+
- name: Check formatting
52+
run: cargo fmt --all -- --check
53+
54+
- name: Run clippy
55+
run: cargo clippy --all-targets --all-features -- -D warnings
56+
57+
- name: Build
58+
run: cargo build --verbose
59+
60+
- name: Run tests
61+
run: cargo test --verbose
62+
63+
- name: Run tests with all features
64+
run: cargo test --all-features --verbose
65+
66+
- name: Run tests without default features
67+
run: cargo test --no-default-features --verbose
68+
69+
security_audit:
70+
name: Security Audit
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v4
74+
- uses: rustsec/[email protected]
75+
with:
76+
token: ${{ secrets.GITHUB_TOKEN }}
77+
78+
coverage:
79+
name: Code Coverage
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v4
83+
with:
84+
submodules: recursive
85+
86+
- name: Install Rust
87+
uses: dtolnay/rust-toolchain@stable
88+
with:
89+
components: llvm-tools-preview
90+
91+
- name: Install cargo-llvm-cov
92+
uses: taiki-e/install-action@cargo-llvm-cov
93+
94+
- name: Generate code coverage
95+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
96+
97+
- name: Upload coverage to Codecov
98+
uses: codecov/codecov-action@v4
99+
with:
100+
files: lcov.info
101+
fail_ci_if_error: true
102+

.github/workflows/docs.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
docs:
14+
name: Build and Deploy Documentation
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
21+
- name: Install Rust
22+
uses: dtolnay/rust-toolchain@stable
23+
24+
- name: Cache cargo registry
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.cargo/registry
28+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
29+
30+
- name: Cache cargo index
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.cargo/git
34+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
35+
36+
- name: Cache cargo build
37+
uses: actions/cache@v4
38+
with:
39+
path: target
40+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
41+
42+
- name: Build documentation
43+
run: cargo doc --all-features --no-deps
44+
45+
- name: Deploy to GitHub Pages
46+
if: github.ref == 'refs/heads/main'
47+
uses: peaceiris/actions-gh-pages@v4
48+
with:
49+
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
publish_dir: ./target/doc
51+
force_orphan: true
52+
53+
docs_rs_check:
54+
name: Check docs.rs compatibility
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
with:
59+
submodules: recursive
60+
61+
- name: Install Rust nightly
62+
uses: dtolnay/rust-toolchain@nightly
63+
64+
- name: Install cargo-docs-rs
65+
run: cargo install cargo-docs-rs
66+
67+
- name: Check docs.rs build
68+
run: cargo docs-rs

.github/workflows/release.yml

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
test:
13+
name: Test Suite
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- name: Install Rust
21+
uses: dtolnay/rust-toolchain@stable
22+
with:
23+
components: rustfmt, clippy
24+
25+
- name: Cache cargo registry
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.cargo/registry
29+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
30+
31+
- name: Cache cargo index
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.cargo/git
35+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
36+
37+
- name: Cache cargo build
38+
uses: actions/cache@v4
39+
with:
40+
path: target
41+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
42+
43+
- name: Check formatting
44+
run: cargo fmt --all -- --check
45+
46+
- name: Run clippy
47+
run: cargo clippy --all-targets --all-features -- -D warnings
48+
49+
- name: Build
50+
run: cargo build --verbose
51+
52+
- name: Run tests
53+
run: cargo test --verbose
54+
55+
- name: Run tests with all features
56+
run: cargo test --all-features --verbose
57+
58+
build:
59+
name: Build Release Binaries
60+
needs: test
61+
runs-on: ${{ matrix.os }}
62+
strategy:
63+
matrix:
64+
include:
65+
- os: ubuntu-latest
66+
target: x86_64-unknown-linux-gnu
67+
artifact_name: submod
68+
asset_name: submod-linux-x86_64
69+
- os: ubuntu-latest
70+
target: x86_64-unknown-linux-musl
71+
artifact_name: submod
72+
asset_name: submod-linux-x86_64-musl
73+
- os: windows-latest
74+
target: x86_64-pc-windows-msvc
75+
artifact_name: submod.exe
76+
asset_name: submod-windows-x86_64.exe
77+
- os: macos-latest
78+
target: x86_64-apple-darwin
79+
artifact_name: submod
80+
asset_name: submod-macos-x86_64
81+
- os: macos-latest
82+
target: aarch64-apple-darwin
83+
artifact_name: submod
84+
asset_name: submod-macos-aarch64
85+
86+
steps:
87+
- uses: actions/checkout@v4
88+
with:
89+
submodules: recursive
90+
91+
- name: Install Rust
92+
uses: dtolnay/rust-toolchain@stable
93+
with:
94+
targets: ${{ matrix.target }}
95+
96+
- name: Install musl-tools (Linux musl)
97+
if: matrix.target == 'x86_64-unknown-linux-musl'
98+
run: sudo apt-get update && sudo apt-get install -y musl-tools
99+
100+
- name: Cache cargo registry
101+
uses: actions/cache@v4
102+
with:
103+
path: ~/.cargo/registry
104+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
105+
106+
- name: Cache cargo index
107+
uses: actions/cache@v4
108+
with:
109+
path: ~/.cargo/git
110+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
111+
112+
- name: Cache cargo build
113+
uses: actions/cache@v4
114+
with:
115+
path: target
116+
key: ${{ runner.os }}-cargo-build-target-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
117+
118+
- name: Build
119+
run: cargo build --release --target ${{ matrix.target }}
120+
121+
- name: Upload artifact
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: ${{ matrix.asset_name }}
125+
path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
126+
127+
publish:
128+
name: Publish to crates.io
129+
needs: [test, build]
130+
runs-on: ubuntu-latest
131+
steps:
132+
- uses: actions/checkout@v4
133+
with:
134+
submodules: recursive
135+
136+
- name: Install Rust
137+
uses: dtolnay/rust-toolchain@stable
138+
139+
- name: Cache cargo registry
140+
uses: actions/cache@v4
141+
with:
142+
path: ~/.cargo/registry
143+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
144+
145+
- name: Cache cargo index
146+
uses: actions/cache@v4
147+
with:
148+
path: ~/.cargo/git
149+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
150+
151+
- name: Publish to crates.io
152+
run: cargo publish --token ${{ secrets.CRATESIO_KEY }}
153+
154+
github_release:
155+
name: Create GitHub Release
156+
needs: [test, build, publish]
157+
runs-on: ubuntu-latest
158+
steps:
159+
- uses: actions/checkout@v4
160+
161+
- name: Download all artifacts
162+
uses: actions/download-artifact@v4
163+
164+
- name: Create Release
165+
uses: softprops/action-gh-release@v2
166+
with:
167+
files: |
168+
submod-linux-x86_64/submod
169+
submod-linux-x86_64-musl/submod
170+
submod-windows-x86_64.exe/submod.exe
171+
submod-macos-x86_64/submod
172+
submod-macos-aarch64/submod
173+
generate_release_notes: true
174+
draft: false
175+
prerelease: false
176+
env:
177+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178+

0 commit comments

Comments
 (0)