Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[alias]
bless = "test --config env.RUSTC_BLESS='1'"
uitest = "test --test compile-test"
uibless = "bless --test compile-test"
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.stderr text eol=lf
*.stdout text eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/cargo-vet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: vet-dependencies
runs-on: ubuntu-latest
env:
CARGO_VET_VERSION: 0.10.1
CARGO_VET_VERSION: 0.10.2

steps:
- uses: actions/checkout@v4
Expand Down
177 changes: 37 additions & 140 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,170 +1,67 @@
# This workflow runs whenever a PR is opened or updated, or a commit is pushed to main. It runs
# several checks:
# - commit_list: produces a list of commits to be checked
# - fmt: checks that the code is formatted according to rustfmt
# - clippy: checks that the code does not contain any clippy warnings
# - doc: checks that the code can be documented without errors
# - hack: check combinations of feature flags
# - msrv: check that the msrv specified in the crate is correct
name: CGA Check

permissions:
contents: read
# This configuration allows maintainers of this repo to create a branch and pull request based on
# the new branch. Restricting the push trigger to the main branch ensures that the PR only gets
# built once.

on:
push:
branches: [main]
pull_request:
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: check
jobs:
fmt:
runs-on: ubuntu-latest
name: stable / fmt
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo fmt --check
run: cargo fmt --check

# Enable once we have a released crate
# semver:
# runs-on: ubuntu-latest
# name: semver
# strategy:
# fail-fast: false
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - name: Install stable
# uses: dtolnay/rust-toolchain@stable
# with:
# components: rustfmt
# - name: cargo-semver-checks
# uses: obi1kenobi/cargo-semver-checks-action@v2

doc:
# run docs generation on nightly rather than stable. This enables features like
# https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an
# API be documented as only available in some specific platforms.
runs-on: ubuntu-latest
name: nightly / doc
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install nightly
uses: dtolnay/rust-toolchain@nightly
- name: cargo doc
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: --cfg docsrs
branches: [main]

hack-clippy:
# cargo-hack checks combinations of feature flags to ensure that features are all additive
# which is required for feature unification
jobs:
check:
runs-on: ubuntu-latest
name: ${{ matrix.toolchain }} / ${{ matrix.target }} / clippy
strategy:
fail-fast: false
matrix:
# Get early warning of new lints which are regularly introduced in beta channels.
toolchain: [stable, beta]
target: [x86_64-unknown-linux-gnu, thumbv8m.main-none-eabihf]
name: check
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
components: clippy
- name: cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack
# intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4
# --feature-powerset runs for every combination of features
- name: cargo hack
run: cargo hack --feature-powerset --target ${{ matrix.target }} clippy --locked -- -Dwarnings -D clippy::suspicious -D clippy::correctness -D clippy::perf -D clippy::style
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Fetch dependencies
run: cargo fetch --locked
- name: Format check
run: cargo fmt --all --check
- name: Build
run: |
cargo build --locked
cargo build --locked --tests
- name: Clippy
run: cargo clippy --locked
- name: Test
run: cargo test --locked

deny:
# cargo-deny checks licenses, advisories, sources, and bans for
# our dependencies.
runs-on: ubuntu-latest
name: ubuntu / stable / deny
name: deny
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo install cargo-deny
persist-credentials: false
- name: Deny
uses: EmbarkStudios/cargo-deny-action@v2
with:
log-level: warn
manifest-path: ./Cargo.toml
command: check
arguments: --all-features --locked

test:
runs-on: ubuntu-latest
name: ubuntu / stable / test
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: cargo test
run: cargo hack --feature-powerset test --locked
- name: cargo clippy test
run: cargo hack --feature-powerset clippy --tests --locked -- -Dwarnings -D clippy::suspicious -D clippy::correctness -D clippy::perf -D clippy::style

msrv:
# check that we can build using the minimal rust version that is specified by this crate
runs-on: ubuntu-latest
# we use a matrix here just because env can't be used in job names
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
strategy:
fail-fast: false
matrix:
msrv: ["1.85"]
name: ubuntu / ${{ matrix.msrv }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install ${{ matrix.msrv }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.msrv }}
- name: cargo +${{ matrix.msrv }} check
run: cargo check --locked

machete:
# cargo-machete checks for unused dependencies in Cargo.toml files
runs-on: ubuntu-latest
name: ubuntu / stable / machete
name: machete
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo install cargo-machete
persist-credentials: false
- name: Install toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install cargo-machete
uses: taiki-e/install-action@cargo-machete
- name: cargo machete
- name: Machete
run: cargo machete

30 changes: 0 additions & 30 deletions .github/workflows/nostd.yml

This file was deleted.

15 changes: 6 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/
/target
main
rustc-ice-*
/tests/**/target
callgraph.json

# Avoid ignoring the lock file by default, if you want to check it in, do so manually
# Cargo.lock
*/Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
15 changes: 2 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
{
"editor.formatOnSave": true,
"rust-analyzer.checkOnSave": true,
"rust-analyzer.check.allTargets": false,
"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf",
"rust-analyzer.cargo.features": "all",
"rust-analyzer.check.command": "clippy",
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
}
}
"rust-analyzer.rustc.source": "discover"
}
Loading
Loading