expressive/.github/workflows/ci.yml

317 lines
7.4 KiB
YAML
Raw Normal View History

2023-04-13 11:54:01 +00:00
name: CI
2021-06-02 14:04:49 +00:00
2023-04-13 11:54:01 +00:00
on:
pull_request:
push:
2021-06-02 14:04:49 +00:00
2023-04-13 11:54:01 +00:00
env:
RUSTFLAGS: -Dwarnings
2021-06-02 14:04:49 +00:00
2023-04-13 11:54:01 +00:00
jobs:
precheck_default:
name: Check default
runs-on: ${{ matrix.os }}
2021-06-02 14:04:49 +00:00
strategy:
matrix:
2023-04-13 11:54:01 +00:00
os: [ubuntu-latest]
rust: [stable]
2021-06-02 14:04:49 +00:00
steps:
2023-04-13 11:54:01 +00:00
- uses: actions/checkout@master
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Check
uses: actions-rs/cargo@v1
2021-06-02 14:04:49 +00:00
with:
2023-04-13 11:54:01 +00:00
command: check
args: --all --bins --examples --lib
precheck_all_features:
name: Check all features
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]
2021-06-02 14:04:49 +00:00
2023-04-13 11:54:01 +00:00
steps:
- uses: actions/checkout@master
- name: Install ${{ matrix.rust }}
2021-06-02 15:00:50 +00:00
uses: actions-rs/toolchain@v1
2021-06-02 14:04:49 +00:00
with:
2023-04-13 11:54:01 +00:00
toolchain: ${{ matrix.rust }}
2021-06-02 14:21:55 +00:00
override: true
2021-06-02 14:04:49 +00:00
2023-04-13 11:54:01 +00:00
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Check
2022-03-16 14:26:11 +00:00
uses: actions-rs/cargo@v1
with:
2023-04-13 11:54:01 +00:00
command: check
2023-04-13 11:57:39 +00:00
args: --all-features --all --bins --examples --tests --lib
2023-04-13 11:54:01 +00:00
check_msrv:
needs: [precheck_default, precheck_all_features]
name: Check MSRV with all features
2023-04-13 12:46:44 +00:00
runs-on: ubuntu-latest
2023-04-13 11:54:01 +00:00
steps:
- uses: actions/checkout@master
2023-04-13 12:46:44 +00:00
- name: Install MSRV toolchain
2023-04-13 11:54:01 +00:00
uses: actions-rs/toolchain@v1
with:
2023-06-01 13:28:55 +00:00
toolchain: 1.65.0
2023-04-13 11:54:01 +00:00
override: true
- name: Rust cache
uses: Swatinem/rust-cache@v2
2022-03-16 14:26:11 +00:00
2023-04-13 11:54:01 +00:00
- name: Check
2021-06-02 14:04:49 +00:00
uses: actions-rs/cargo@v1
with:
2023-04-13 11:54:01 +00:00
command: check
2023-04-13 11:57:39 +00:00
args: --all-features --all --bins --examples --tests --lib
check_benches:
needs: [precheck_default, precheck_all_features]
name: Check benches with all features
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
rust: [ nightly ]
steps:
- uses: actions/checkout@master
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --all-features --all --bins --benches --examples --tests --lib
2021-06-02 15:00:50 +00:00
2023-04-13 12:00:55 +00:00
check_sync_readme:
needs: [precheck_default, precheck_all_features]
name: Check sync readme
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
rust: [ stable ]
steps:
- uses: actions/checkout@master
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Install cargo-sync-readme
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-sync-readme
- name: Sync readme check
uses: actions-rs/cargo@v1
with:
command: sync-readme
args: --check
2023-04-13 11:54:01 +00:00
check_platform_compatibility:
needs: [precheck_default, precheck_all_features]
name: Check platform compatibility
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
rust: [stable]
2021-06-02 15:00:50 +00:00
steps:
2023-04-13 11:54:01 +00:00
- uses: actions/checkout@master
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Rust cache
uses: Swatinem/rust-cache@v2
2021-06-02 15:00:50 +00:00
with:
2023-04-13 11:54:01 +00:00
key: ${{ matrix.os }}
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
2023-04-13 11:57:39 +00:00
args: --all-features --all --bins --examples --tests --lib
2023-04-13 11:54:01 +00:00
2023-06-01 12:41:12 +00:00
check_cli:
needs: [ precheck_default, precheck_all_features ]
name: Check CLI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
rust: [ stable ]
steps:
- uses: actions/checkout@master
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: CLI
uses: GuillaumeFalourd/assert-command-line-output@v2
with:
2023-06-01 12:46:40 +00:00
command_line: cargo run -- p = 2\; p + 3
2023-06-01 12:41:12 +00:00
contains: 5
expected_result: PASSED
2023-04-13 11:54:01 +00:00
detailed_tests:
needs: [precheck_default, precheck_all_features]
name: Check, test, doc, format and lint with all features
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust: [stable, beta, nightly]
steps:
- uses: actions/checkout@master
2021-06-02 15:00:50 +00:00
2023-04-13 11:54:01 +00:00
- name: Install ${{ matrix.rust }}
2021-06-02 15:00:50 +00:00
uses: actions-rs/toolchain@v1
with:
2023-04-13 11:54:01 +00:00
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
2021-06-02 15:00:50 +00:00
override: true
2023-04-13 11:54:01 +00:00
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
2023-04-13 11:57:39 +00:00
args: --all-features --all --bins --examples --tests --lib
2023-04-13 11:54:01 +00:00
- name: Test
uses: actions-rs/cargo@v1
2021-06-02 15:00:50 +00:00
with:
2023-04-13 11:54:01 +00:00
command: test
args: --all-features --all
2021-06-02 15:00:50 +00:00
2023-04-13 11:54:01 +00:00
- name: Docs
2021-06-02 15:00:50 +00:00
uses: actions-rs/cargo@v1
with:
2023-04-13 11:54:01 +00:00
command: doc
args: --all-features
2021-06-02 15:00:50 +00:00
2023-04-13 11:54:01 +00:00
- name: Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Lint
uses: actions-rs/cargo@v1
2021-06-02 15:00:50 +00:00
with:
2023-04-13 11:54:01 +00:00
command: clippy
2023-04-13 12:55:21 +00:00
args: --all-features --bins --examples --tests --lib
coveralls_io:
needs: [detailed_tests]
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ⚡ Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install stable toolchain
2023-04-13 12:55:21 +00:00
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
default: true
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
default: false
2023-04-13 12:55:21 +00:00
- name: Install cargo-tarpaulin
uses: actions-rs/install@v0.1
with:
crate: cargo-tarpaulin
version: latest
use-tool-cache: true
- name: Coverage Report with tarpaulin
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: --all-features --out Lcov --run-types Tests Doctests -- --test-threads 1
2023-04-13 12:55:21 +00:00
- name: Upload Coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info