2021-06-12 20:18:21 +02:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-08-07 11:11:29 +02:00
|
|
|
- main
|
2021-06-12 20:18:21 +02:00
|
|
|
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:
|
2021-11-09 12:53:57 +01:00
|
|
|
toolchain: nightly
|
2021-08-07 11:06:42 +02:00
|
|
|
override: true
|
2021-06-12 20:18:21 +02:00
|
|
|
profile: minimal
|
2021-11-09 12:53:57 +01:00
|
|
|
components: clippy, rustfmt
|
2021-10-19 22:25:06 +02:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-06-12 20:18:21 +02:00
|
|
|
- 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
|
|
|
|
|
2021-06-12 21:44:40 +02:00
|
|
|
check-docs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2021-08-07 11:06:42 +02:00
|
|
|
override: true
|
2021-06-12 21:44:40 +02:00
|
|
|
profile: minimal
|
2021-10-19 22:25:06 +02:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-06-12 21:44:40 +02:00
|
|
|
- name: cargo doc
|
2021-08-07 11:06:42 +02:00
|
|
|
env:
|
2021-11-11 17:33:33 +01:00
|
|
|
RUSTDOCFLAGS: "-D broken-intra-doc-links"
|
2021-06-12 21:44:40 +02:00
|
|
|
run: cargo doc --all-features --no-deps
|
|
|
|
|
2021-06-12 20:18:21 +02:00
|
|
|
cargo-hack:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2021-08-07 11:06:42 +02:00
|
|
|
override: true
|
2021-06-12 20:18:21 +02:00
|
|
|
profile: minimal
|
2021-10-19 22:25:06 +02:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-06-12 20:18:21 +02:00
|
|
|
- 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:
|
2021-11-03 10:22:31 +01:00
|
|
|
rust: [stable, beta, nightly]
|
2021-06-12 20:18:21 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
2021-08-07 11:06:42 +02:00
|
|
|
override: true
|
2021-06-12 20:18:21 +02:00
|
|
|
profile: minimal
|
2021-10-19 22:25:06 +02:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-06-12 20:18:21 +02:00
|
|
|
- name: Run tests
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
2021-06-19 13:44:21 +02:00
|
|
|
args: --all --all-features --all-targets
|
2021-06-12 20:18:21 +02:00
|
|
|
|
2021-11-03 10:22:31 +01:00
|
|
|
# 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:
|
2021-11-11 17:33:33 +01:00
|
|
|
toolchain: 1.54
|
2021-11-03 10:22:31 +01:00
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
- name: Run tests
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
2021-11-11 17:33:33 +01:00
|
|
|
args: >
|
|
|
|
-p axum
|
|
|
|
--all-features --all-targets
|
2021-11-11 21:26:08 +01:00
|
|
|
# the compiler errors are different on 1.54 which makes
|
|
|
|
# the trybuild tests in axum-debug fail, so just run the doc
|
|
|
|
# tests
|
|
|
|
- name: Run axum-debug doc tests
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: >
|
|
|
|
-p axum-debug
|
|
|
|
--doc
|
|
|
|
--all-features
|
2021-11-03 10:22:31 +01:00
|
|
|
|
2021-08-19 09:34:48 +02:00
|
|
|
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
|
2021-10-19 22:25:06 +02:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-08-19 09:34:48 +02:00
|
|
|
- name: Run doc tests
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --all-features --doc
|
|
|
|
|
2021-06-12 20:18:21 +02:00
|
|
|
deny-check:
|
|
|
|
name: cargo-deny check
|
|
|
|
runs-on: ubuntu-latest
|
2021-11-03 12:38:48 +01:00
|
|
|
continue-on-error: ${{ matrix.checks == 'advisories' }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
checks:
|
|
|
|
- advisories
|
|
|
|
- bans licenses sources
|
2021-06-12 20:18:21 +02:00
|
|
|
steps:
|
2021-11-03 12:38:48 +01:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: EmbarkStudios/cargo-deny-action@v1
|
|
|
|
with:
|
|
|
|
command: check ${{ matrix.checks }}
|
|
|
|
arguments: --all-features --manifest-path axum/Cargo.toml
|