2020-07-02 15:01:45 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
2020-08-17 17:30:19 +02:00
|
|
|
branches: [ master, dev ]
|
2019-11-27 15:30:33 +01:00
|
|
|
|
|
|
|
name: Continuous integration
|
|
|
|
|
2022-03-14 16:28:20 +01:00
|
|
|
env:
|
2022-07-03 12:35:56 +02:00
|
|
|
RUSTFLAGS: "--cfg CI_REDIS -Dwarnings"
|
|
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
|
|
RUST_BACKTRACE: short
|
|
|
|
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
CARGO_NET_RETRY: 10
|
|
|
|
RUSTUP_MAX_RETRIES: 10
|
|
|
|
|
|
|
|
rust_nightly: nightly-2022-07-01
|
|
|
|
# When updating this, also update:
|
|
|
|
# - README.md
|
|
|
|
# - src/lib.rs
|
|
|
|
# - down below in a matrix
|
|
|
|
rust_msrv: 1.58.0
|
2022-03-14 16:28:20 +01:00
|
|
|
|
2019-11-27 15:30:33 +01:00
|
|
|
jobs:
|
2022-07-03 12:35:56 +02:00
|
|
|
# Depends on all action that are required for a "successful" CI run.
|
|
|
|
ci-pass:
|
|
|
|
name: CI succeeded
|
2019-11-27 15:30:33 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-03-21 13:34:23 +01:00
|
|
|
|
2022-07-03 12:35:56 +02:00
|
|
|
needs:
|
|
|
|
- fmt
|
|
|
|
- test
|
|
|
|
- check-examples
|
|
|
|
- clippy
|
|
|
|
- doc
|
2021-03-21 13:34:23 +01:00
|
|
|
|
2022-07-03 12:35:56 +02:00
|
|
|
steps:
|
|
|
|
- run: exit 0
|
2021-03-21 13:34:23 +01:00
|
|
|
|
2022-07-03 12:35:56 +02:00
|
|
|
fmt:
|
|
|
|
name: fmt
|
2021-03-21 13:34:23 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-07-03 12:35:56 +02:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2021-03-21 13:34:23 +01:00
|
|
|
|
2022-07-03 12:35:56 +02:00
|
|
|
- name: Install Rust ${{ env.rust_nightly }}
|
|
|
|
uses: actions-rs/toolchain@v1
|
2019-11-27 15:30:33 +01:00
|
|
|
with:
|
2020-07-03 14:50:28 +02:00
|
|
|
profile: minimal
|
2022-07-03 12:35:56 +02:00
|
|
|
toolchain: ${{ env.rust_nightly }}
|
2020-07-03 14:50:28 +02:00
|
|
|
override: true
|
2022-07-03 12:35:56 +02:00
|
|
|
components: rustfmt
|
2021-03-21 13:34:23 +01:00
|
|
|
|
2022-07-03 12:35:56 +02:00
|
|
|
- name: Cache Dependencies
|
|
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
|
|
|
|
- name: Check formatting
|
2021-03-21 13:34:23 +01:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
2022-07-03 12:35:56 +02:00
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
2020-08-12 22:53:58 +02:00
|
|
|
|
|
|
|
test:
|
2022-07-03 12:35:56 +02:00
|
|
|
name: Test
|
2020-07-02 14:48:37 +02:00
|
|
|
runs-on: ubuntu-latest
|
2020-08-12 22:53:58 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-03-21 13:34:23 +01:00
|
|
|
rust:
|
2020-08-12 22:53:58 +02:00
|
|
|
- stable
|
|
|
|
- beta
|
2022-03-25 10:19:57 +01:00
|
|
|
- nightly
|
2022-04-20 21:33:44 +02:00
|
|
|
- msrv
|
2021-03-21 13:34:23 +01:00
|
|
|
|
2020-08-12 22:53:58 +02:00
|
|
|
include:
|
|
|
|
- rust: stable
|
2022-03-25 10:19:57 +01:00
|
|
|
toolchain: stable
|
2021-03-21 13:34:23 +01:00
|
|
|
features: "--features full"
|
2020-08-12 22:53:58 +02:00
|
|
|
- rust: beta
|
2022-03-25 10:19:57 +01:00
|
|
|
toolchain: beta
|
2021-03-21 13:34:23 +01:00
|
|
|
features: "--features full"
|
2022-03-25 10:19:57 +01:00
|
|
|
- rust: nightly
|
2022-07-03 12:24:42 +02:00
|
|
|
toolchain: nightly-2022-07-01
|
2020-08-12 22:53:58 +02:00
|
|
|
features: "--all-features"
|
2022-04-20 21:33:44 +02:00
|
|
|
- rust: msrv
|
2022-07-03 12:35:56 +02:00
|
|
|
toolchain: 1.58.0
|
2022-04-21 10:52:01 +02:00
|
|
|
features: "--features full"
|
2020-08-12 22:53:58 +02:00
|
|
|
|
2022-07-03 12:35:56 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install Rust ${{ matrix.toolchain }}
|
|
|
|
uses: actions-rs/toolchain@v1
|
2019-11-27 15:30:33 +01:00
|
|
|
with:
|
2020-07-03 14:50:28 +02:00
|
|
|
profile: minimal
|
2022-03-25 10:19:57 +01:00
|
|
|
toolchain: ${{ matrix.toolchain }}
|
2020-07-03 14:50:28 +02:00
|
|
|
override: true
|
2022-07-03 12:35:56 +02:00
|
|
|
|
|
|
|
- name: Cache Dependencies
|
|
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
|
2022-07-04 17:34:11 +02:00
|
|
|
# NB. Don't test (build) examples so we can use non-msrv features in them (--tests/--doc)
|
2022-07-03 12:35:56 +02:00
|
|
|
- name: Compile
|
2020-08-12 22:53:58 +02:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
2022-07-03 12:35:56 +02:00
|
|
|
command: test
|
2022-07-04 17:34:11 +02:00
|
|
|
args: --tests --no-run --verbose ${{ matrix.features }}
|
2022-07-03 12:35:56 +02:00
|
|
|
|
2020-08-12 23:07:16 +02:00
|
|
|
- name: Setup redis
|
|
|
|
run: |
|
|
|
|
sudo apt install redis-server
|
|
|
|
redis-server --port 7777 > /dev/null &
|
|
|
|
redis-server --port 7778 > /dev/null &
|
|
|
|
redis-server --port 7779 > /dev/null &
|
2022-07-03 12:35:56 +02:00
|
|
|
|
2022-07-03 12:38:14 +02:00
|
|
|
- name: Test unit & integration tests
|
2020-08-12 22:53:58 +02:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
2022-07-03 12:38:14 +02:00
|
|
|
args: --tests --verbose ${{ matrix.features }}
|
|
|
|
|
|
|
|
- name: Test documentation tests
|
2022-07-19 16:12:45 +02:00
|
|
|
if: ${{ matrix.rust != 'msrv' }}
|
2022-07-03 12:38:14 +02:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --doc --verbose ${{ matrix.features }}
|
2020-08-12 22:53:58 +02:00
|
|
|
|
2022-07-03 12:35:56 +02:00
|
|
|
check-examples:
|
2020-07-02 14:48:37 +02:00
|
|
|
runs-on: ubuntu-latest
|
2022-07-03 12:35:56 +02:00
|
|
|
|
2020-07-02 14:52:42 +02:00
|
|
|
steps:
|
2022-07-03 12:35:56 +02:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install Rust stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
2020-03-27 13:54:06 +01:00
|
|
|
with:
|
2020-07-03 14:50:28 +02:00
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
2022-07-03 12:35:56 +02:00
|
|
|
|
|
|
|
- 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
|
|
|
|
components: clippy
|
|
|
|
|
|
|
|
- name: Cache Dependencies
|
|
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
|
|
|
|
- name: clippy
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
|
|
|
args: --all-targets --all-features
|
|
|
|
|
|
|
|
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
|