experiment with CI

This commit is contained in:
Maybe Waffle 2022-06-28 18:36:02 +04:00
parent 9b44eb794c
commit e2289aad14

View file

@ -1,3 +1,5 @@
name: Continuous integration
on: on:
push: push:
branches: branches:
@ -6,29 +8,63 @@ on:
branches: branches:
- master - master
name: Continuous integration env:
RUSTFLAGS: -Dwarnings
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
jobs: jobs:
style: # 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
steps:
- run: exit 0
fmt:
name: fmt
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - name: Checkout
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
toolchain: nightly-2022-01-17 toolchain: ${{ env.rust_nightly }}
override: true override: true
components: rustfmt components: rustfmt
- name: fmt - name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Check formatting
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: fmt command: fmt
args: --all -- --check args: --all -- --check
test: test:
name: Test
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
@ -49,45 +85,79 @@ jobs:
toolchain: nightly-2022-01-17 toolchain: nightly-2022-01-17
features: "--all-features" features: "--all-features"
- rust: msrv - rust: msrv
toolchain: 1.58.0
features: "--features full" features: "--features full"
toolchain: "1.58.0"
steps: steps:
- uses: actions/checkout@v1 - name: Checkout
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
toolchain: ${{ matrix.toolchain }} toolchain: ${{ matrix.toolchain }}
override: true override: true
- name: build - name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Compile
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: build command: test
args: --verbose ${{ matrix.features }} args: --no-run --verbose ${{ matrix.features }}
- name: test - name: Test
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: test command: test
args: --verbose ${{ matrix.features }} args: --verbose ${{ matrix.features }}
clippy: check-examples:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - name: Checkout
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - name: Install Rust stable
uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
toolchain: nightly-2022-01-17 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
clippy:
name: Run linter
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 override: true
components: clippy components: clippy
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: clippy - name: clippy
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: clippy command: clippy
args: --all-targets --all-features -- -D warnings args: --all-targets --all-features