axum/.github/workflows/CI.yml
David Pedersen debc3f5be9
Don't run nightly on CI (#870)
* Exclude sqlx example

Getting an ICE
https://github.com/tokio-rs/axum/runs/5602144413?check_suite_focus=true.
Will look into that later.

* actually it was nightly's fault

* and don't test things on nightly
2022-03-18 16:28:23 +01:00

181 lines
4.5 KiB
YAML

name: CI
env:
CARGO_TERM_COLOR: always
on:
push:
branches:
- main
pull_request: {}
jobs:
check:
# Run `cargo check` first to ensure that the pushed code at least compiles.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: beta
override: true
profile: minimal
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v1
- name: Check
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --all-targets --all-features
- name: rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: cargo doc
env:
RUSTDOCFLAGS: "-D broken-intra-doc-links"
run: cargo doc --all-features --no-deps
cargo-hack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: Install cargo-hack
run: |
curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
- name: cargo hack check
run: cargo hack check --each-feature --no-dev-deps --all
test-versions:
needs: check
runs-on: ubuntu-latest
strategy:
matrix:
# nightly has an ICE, so ignore it for now
# rust: [stable, beta, nightly]
rust: [stable, beta]
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --all-features --all-targets
# some examples doesn't support 1.54 (such as async-graphql)
# so we only test axum itself on 1.54
test-msrv:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.54
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: >
-p axum
-p axum-extra
--all-features --all-targets
# the compiler errors are different on 1.54 which makes
# the trybuild tests in axum-macros fail, so just run the doc
# tests
- name: Run axum-macros doc tests
uses: actions-rs/cargo@v1
with:
command: test
args: >
-p axum-macros
--doc
--all-features
test-docs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: Run doc tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --doc
deny-check:
name: cargo-deny check
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.checks == 'advisories' }}
strategy:
matrix:
checks:
- advisories
- bans licenses sources
steps:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
arguments: --all-features --manifest-path axum/Cargo.toml
armv5te-unknown-linux-musleabi:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: armv5te-unknown-linux-musleabi
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: Check
uses: actions-rs/cargo@v1
env:
# Clang has native cross-compilation support
CC: clang
with:
command: check
args: >
--all-targets
--all-features
-p axum
-p axum-core
-p axum-extra
-p axum-macros
--target armv5te-unknown-linux-musleabi