Fix handling of None in Num::add (#88) #200
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
name: Rust | |
on: | |
merge_group: | |
push: | |
branches: [main] | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: [ubuntu-latest] | |
strategy: | |
fail-fast: false | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: lurk-lab/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: taiki-e/install-action@nextest | |
- uses: Swatinem/rust-cache@v2 | |
# make sure benches don't bit-rot | |
- name: build benches | |
run: cargo build --benches --release | |
- name: cargo test | |
run: | | |
cargo nextest run --release --profile ci | |
- name: Doctests | |
run: | | |
cargo test --doc | |
check-lurk-compiles: | |
if: github.event_name == 'pull_request' | |
runs-on: [ubuntu-latest] | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: lurk-lab/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: ./.github/actions/install-deps | |
with: | |
packages: 'pkg-config libssl-dev protobuf-compiler libprotobuf-dev' | |
- uses: actions/checkout@v4 | |
with: | |
path: ${{ github.workspace }}/bellpepper | |
- uses: actions/checkout@v4 | |
with: | |
repository: lurk-lab/lurk-rs | |
path: ${{ github.workspace }}/lurk | |
submodules: recursive | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Patch Cargo.toml | |
working-directory: ${{ github.workspace }}/lurk | |
run: | | |
echo "[patch.'https://github.com/lurk-lab/bellpepper']" >> Cargo.toml | |
echo "bellpepper = { path='../bellpepper/crates/bellpepper' }" >> Cargo.toml | |
echo "[patch.crates-io]" >> Cargo.toml | |
echo "bellpepper-core = { path='../bellpepper/crates/bellpepper-core' }" >> Cargo.toml | |
- name: Check Lurk-rs types don't break spectacularly | |
working-directory: ${{ github.workspace }}/lurk | |
run: cargo check --all --tests --benches --examples | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v2 | |
# See '.cargo/config' for list of enabled/disabled clippy lints | |
- name: rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all --check | |
- name: cargo clippy | |
run: cargo xclippy -D warnings | |
msrv: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: | |
- "bellpepper-core" | |
- "bellpepper" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install rustup | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install cargo-msrv | |
run: cargo install cargo-msrv | |
- name: Check Rust MSRV | |
run: cargo msrv verify | |
working-directory: crates/${{ matrix.package }} | |
# Check documentation links aren't broken | |
link-checker: | |
uses: lurk-lab/ci-workflows/.github/workflows/links-check.yml@main | |
with: | |
fail-fast: true | |
# Lint dependencies for licensing and auditing issues as per https://github.com/lurk-lab/bellpepper/blob/main/deny.toml | |
licenses-audits: | |
uses: lurk-lab/ci-workflows/.github/workflows/licenses-audits.yml@main |