teloxide/.github/workflows/ci.yml

191 lines
4 KiB
YAML
Raw Normal View History

2022-06-28 16:36:02 +02:00
name: Continuous integration
2020-08-12 17:04:50 +02:00
on:
push:
branches:
- master
pull_request:
branches:
- master
2022-06-28 16:36:02 +02:00
env:
RUSTFLAGS: -Dwarnings
2022-06-28 18:12:36 +02:00
RUSTDOCFLAGS: -Dwarnings
2022-06-28 16:36:02 +02:00
RUST_BACKTRACE: short
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
rust_nightly: nightly-2022-01-17
# When updating this, also update:
# - README.md
# - src/lib.rs
# - down below in a matrix
rust_msrv: 1.58.0
2020-08-12 17:04:50 +02:00
2022-08-09 19:07:18 +02:00
CI: 1
2020-08-12 17:04:50 +02:00
jobs:
2022-06-28 16:36:02 +02:00
# Depends on all action that are required for a "successful" CI run.
ci-pass:
name: CI succeeded
runs-on: ubuntu-latest
needs:
- fmt
- test
- check-examples
- clippy
2022-06-28 18:12:36 +02:00
- doc
2022-06-28 16:36:02 +02:00
steps:
- run: exit 0
fmt:
name: fmt
runs-on: ubuntu-latest
steps:
2022-06-28 16:36:02 +02:00
- name: Checkout
uses: actions/checkout@v3
2022-06-28 16:36:02 +02:00
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
2022-06-28 16:36:02 +02:00
toolchain: ${{ env.rust_nightly }}
override: true
components: rustfmt
2022-06-28 16:36:02 +02:00
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
2022-06-28 16:36:02 +02:00
args: --all -- --check
2020-08-12 17:04:50 +02:00
test:
2022-06-28 16:36:02 +02:00
name: Test
2020-08-12 17:04:50 +02:00
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
2022-03-25 10:12:26 +01:00
- nightly
2022-04-18 20:15:13 +02:00
- msrv
2020-08-12 17:04:50 +02:00
include:
- rust: stable
2022-03-25 10:12:26 +01:00
toolchain: stable
features: "--features full"
2020-08-12 17:04:50 +02:00
- rust: beta
2022-03-25 10:12:26 +01:00
toolchain: beta
features: "--features full"
2022-03-25 10:12:26 +01:00
- rust: nightly
toolchain: nightly-2022-01-17
2020-08-12 17:04:50 +02:00
features: "--all-features"
2022-04-18 20:15:13 +02:00
- rust: msrv
2022-06-28 16:36:02 +02:00
toolchain: 1.58.0
2022-04-18 20:15:13 +02:00
features: "--features full"
2020-08-12 17:04:50 +02:00
2022-06-28 16:36:02 +02:00
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
2020-08-12 17:04:50 +02:00
with:
profile: minimal
2022-03-25 10:12:26 +01:00
toolchain: ${{ matrix.toolchain }}
2020-08-12 17:04:50 +02:00
override: true
2022-06-28 16:36:02 +02:00
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Compile
2020-08-12 17:04:50 +02:00
uses: actions-rs/cargo@v1
with:
2022-06-28 16:36:02 +02:00
command: test
args: --no-run --verbose ${{ matrix.features }}
2020-08-12 17:04:50 +02:00
2022-06-28 16:36:02 +02:00
- name: Test
2020-08-12 17:04:50 +02:00
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose ${{ matrix.features }}
2022-06-28 16:36:02 +02:00
check-examples:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Check examples
uses: actions-rs/cargo@v1
with:
command: check
args: --examples --features full
2020-08-12 17:04:50 +02:00
clippy:
2022-06-28 16:36:02 +02:00
name: Run linter
2020-08-12 17:04:50 +02:00
runs-on: ubuntu-latest
steps:
2022-06-28 16:36:02 +02:00
- name: Checkout
uses: actions/checkout@v3
2020-08-12 17:04:50 +02:00
2022-06-28 16:36:02 +02:00
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
2020-08-12 17:04:50 +02:00
with:
profile: minimal
2022-06-28 16:36:02 +02:00
toolchain: ${{ env.rust_nightly }}
2020-08-12 17:04:50 +02:00
override: true
components: clippy
2022-06-28 16:36:02 +02:00
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
2020-08-12 17:04:50 +02:00
- name: clippy
uses: actions-rs/cargo@v1
with:
command: clippy
2022-06-28 16:36:02 +02:00
args: --all-targets --all-features
2022-06-28 18:12:36 +02:00
doc:
name: check docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.rust_nightly }}
override: true
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: rustdoc
uses: actions-rs/cargo@v1
with:
command: docs # from .cargo/config.toml