Files
iroh/.github/workflows/ci.yml
T

173 lines
3.6 KiB
YAML

name: CI
on:
pull_request:
push:
branches:
- main
env:
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
MSRV: "1.64"
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 --all-features