-
Notifications
You must be signed in to change notification settings - Fork 4
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
6 changed files
with
406 additions
and
119 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,88 @@ | ||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
name: check | ||
|
||
jobs: | ||
fmt: | ||
runs-on: ubuntu-latest | ||
name: fmt / stable | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt | ||
- name: cargo fmt --check | ||
run: cargo fmt --check | ||
clippy: | ||
permissions: | ||
contents: read | ||
checks: write | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [stable, beta] | ||
name: clippy / ${{ matrix.toolchain }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
components: clippy | ||
- name: cargo clippy | ||
uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
doc: | ||
runs-on: ubuntu-latest | ||
name: doc / nightly | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- name: cargo doc | ||
run: cargo doc --no-deps --all-features | ||
env: | ||
RUSTDOCFLAGS: --cfg docsrs | ||
hack: | ||
runs-on: ubuntu-latest | ||
name: hack / stable | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: taiki-e/install-action@cargo-hack | ||
- name: cargo hack --feature-powerset check | ||
run: cargo hack --feature-powerset check | ||
msrv: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
msrv: | ||
- 1.65.0 | ||
name: msrv / ${{ matrix.msrv }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.msrv }} | ||
- name: cargo +${{ matrix.msrv }} check | ||
run: cargo check |
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,30 @@ | ||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
name: no_std | ||
|
||
jobs: | ||
no_std: | ||
runs-on: ubuntu-latest | ||
name: no_std / ${{ matrix.target }} | ||
strategy: | ||
matrix: | ||
target: [thumbv7m-none-eabi, aarch64-unknown-none] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.target }} | ||
- name: cargo check | ||
run: cargo check --target ${{ matrix.target }} --no-default-features |
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,57 @@ | ||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
name: safety | ||
|
||
jobs: | ||
sanitizers: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- run: | | ||
# to get the symbolizer for debug symbol resolution | ||
sudo apt install llvm | ||
# to fix buggy leak analyzer: | ||
# https://github.com/japaric/rust-san#unrealiable-leaksanitizer | ||
sed -i '/\[features\]/i [profile.dev]' Cargo.toml | ||
sed -i '/profile.dev/a opt-level = 1' Cargo.toml | ||
cat Cargo.toml | ||
- name: cargo test -Zsanitizer=address | ||
run: cargo test --lib --tests --all-features --target x86_64-unknown-linux-gnu | ||
env: | ||
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" | ||
RUSTFLAGS: "-Z sanitizer=address" | ||
- name: cargo test -Zsanitizer=leak | ||
if: always() | ||
run: cargo test --all-features --target x86_64-unknown-linux-gnu | ||
env: | ||
LSAN_OPTIONS: "suppressions=lsan-suppressions.txt" | ||
RUSTFLAGS: "-Z sanitizer=leak" | ||
miri: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- run: | | ||
echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.NIGHTLY }} | ||
components: miri | ||
- name: cargo miri test | ||
run: cargo miri test | ||
env: | ||
MIRIFLAGS: "" |
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,85 @@ | ||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
name: test | ||
|
||
jobs: | ||
required: | ||
runs-on: ubuntu-latest | ||
name: required / ${{ matrix.toolchain }} | ||
strategy: | ||
matrix: | ||
toolchain: [stable, beta] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
- name: cargo generate-lockfile | ||
if: hashFiles('Cargo.lock') == '' | ||
run: cargo generate-lockfile | ||
- name: cargo test --locked | ||
run: cargo test --locked --all-features --all-targets | ||
- name: cargo test --doc | ||
run: cargo test --locked --all-features --doc | ||
minimal: | ||
runs-on: ubuntu-latest | ||
name: minimal-versions / stable | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- run: rustup default stable | ||
- run: cargo +nightly update -Zminimal-versions | ||
- name: cargo test --locked | ||
run: cargo test --locked --all-features --all-targets | ||
os-check: | ||
runs-on: ${{ matrix.os }} | ||
name: ${{ matrix.os }} / stable | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@stable | ||
- if: hashFiles('Cargo.lock') == '' | ||
run: cargo generate-lockfile | ||
- name: cargo test | ||
run: cargo test --locked --all-features --all-targets | ||
coverage: | ||
runs-on: ubuntu-latest | ||
name: coverage / nightly | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: clean | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-features --no-fail-fast | ||
env: | ||
CARGO_INCREMENTAL: "0" | ||
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | ||
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | ||
- uses: actions-rs/[email protected] | ||
# TODO: Coveralls or Codecov or try integrating the lcov report to Github Checks? |
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
Oops, something went wrong.