mirror of
https://github.com/n0-computer/iroh.git
synced 2026-12-03 08:01:40 +00:00
This is a minimal cargo deny config which should not give us too many issues. Let's see how this works in practice.
184 lines
3.9 KiB
YAML
184 lines
3.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
RUSTFLAGS: -Dwarnings
|
|
MSRV: "1.63"
|
|
|
|
|
|
jobs:
|
|
build_and_test_nix:
|
|
name: Build and test (Nix)
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macOS-latest]
|
|
rust: [nightly, stable]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install ${{ matrix.rust }}
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
override: true
|
|
|
|
- name: check
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: check
|
|
args: --all --bins --tests
|
|
|
|
- name: tests
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --all
|
|
|
|
build_and_test_windows:
|
|
name: Build and test (Windows)
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [windows-latest]
|
|
rust: [nightly, stable]
|
|
target:
|
|
- x86_64-pc-windows-gnu
|
|
- x86_64-pc-windows-msvc
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install ${{ matrix.rust }}
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
target: ${{ matrix.target }}
|
|
override: true
|
|
|
|
- uses: msys2/setup-msys2@v2
|
|
- name: check
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: check
|
|
args: --all --bins --tests --target ${{ matrix.target }}
|
|
|
|
- name: check bench
|
|
uses: actions-rs/cargo@v1
|
|
if: matrix.rust == 'nightly'
|
|
with:
|
|
command: check
|
|
target: ${{ matrix.target }}
|
|
args: --benches
|
|
|
|
- name: tests
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --all --target ${{ matrix.target }}
|
|
|
|
cross:
|
|
name: Cross compile
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- i686-unknown-linux-gnu
|
|
- arm-linux-androideabi
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install nightly
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
override: true
|
|
|
|
- name: Install cross
|
|
run: cargo install cross
|
|
|
|
- name: check
|
|
run: cross check --all --target ${{ matrix.target }}
|
|
|
|
- name: test
|
|
run: cross test --all --target ${{ matrix.target }}
|
|
|
|
check_fmt_and_docs:
|
|
name: Checking fmt and docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: nightly
|
|
override: true
|
|
components: rustfmt
|
|
|
|
- name: setup
|
|
run: |
|
|
rustup component add rustfmt
|
|
rustc --version
|
|
|
|
- name: fmt
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Docs
|
|
run: cargo doc
|
|
|
|
clippy_check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
components: clippy
|
|
- name: clippy check
|
|
run: cargo clippy --message-format=json --all-features --all-targets
|
|
|
|
msrv:
|
|
name: Minimal Supported Rust Version
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: "${{ env.MSRV }}"
|
|
override: true
|
|
- name: Check MSRV all features
|
|
run: |
|
|
cargo +$MSRV check --workspace --all-targets --no-default-features
|
|
|
|
cargo_deny:
|
|
name: cargo deny
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: EmbarkStudios/cargo-deny-action@v1
|
|
with:
|
|
arguments: --workspace --all-features
|
|
command: check
|
|
command-arguments: "-Dwarnings"
|