-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
104 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Rust CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: Cache Cargo Dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- name: build | ||
run: cargo build | ||
- name: test | ||
run: cargo test | ||
|
||
test_other_archs: | ||
# github actions does not support 32-bit or big endian systems directly, but | ||
# it does support QEMU. so we install qemu, then build and run the tests in | ||
# an emulated system. NOTE: you can also use this approach to test for big | ||
# endian locally. | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: [powerpc-unknown-linux-gnu, i686-unknown-linux-gnu] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install or use cached cross-rs/cross | ||
uses: baptiste0928/cargo-install@v2 | ||
with: | ||
crate: cross | ||
- name: Cache Cargo Dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
key: ${{ matrix.arch }} | ||
- name: Start Docker (required for cross-rs) | ||
run: sudo systemctl start docker | ||
- name: Cross-Run Tests using QEMU | ||
run: cross test --target ${{ matrix.arch }} | ||
|
||
rustfmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt | ||
- name: Run rustfmt check | ||
run: cargo fmt -- --check | ||
|
||
cargo-deny: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: EmbarkStudios/cargo-deny-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# https://embarkstudios.github.io/cargo-deny/ | ||
|
||
[graph] | ||
targets = [ | ||
{ triple = "aarch64-apple-darwin" }, | ||
{ triple = "aarch64-linux-android" }, | ||
{ triple = "x86_64-apple-darwin" }, | ||
{ triple = "x86_64-pc-windows-msvc" }, | ||
{ triple = "x86_64-unknown-linux-gnu" }, | ||
{ triple = "x86_64-unknown-linux-musl" }, | ||
] | ||
|
||
|
||
[licenses] | ||
confidence-threshold = 0.93 | ||
allow = [ | ||
"Apache-2.0 WITH LLVM-exception", | ||
"Apache-2.0", | ||
"BSD-2-Clause", | ||
"BSD-3-Clause", | ||
"MIT", | ||
"MIT-0", | ||
"MPL-2.0", | ||
"Unicode-DFS-2016", | ||
] | ||
|
||
|
||
[advisories] | ||
yanked = "deny" | ||
ignore = [] | ||
|
||
|
||
[bans] | ||
multiple-versions = "allow" | ||
wildcards = "allow" # at least until https://github.com/EmbarkStudios/cargo-deny/issues/241 is fixed | ||
deny = [] | ||
|