2019-10-21 05:44:28 +08:00
|
|
|
name: CI
|
|
|
|
on:
|
|
|
|
push:
|
2023-07-17 04:21:45 +08:00
|
|
|
branches-ignore: [master]
|
2019-10-21 05:44:28 +08:00
|
|
|
pull_request:
|
2023-07-17 04:21:45 +08:00
|
|
|
merge_group:
|
2019-10-21 05:44:28 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Test
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build: [stable, beta, nightly, macos, windows, msrv]
|
|
|
|
include:
|
|
|
|
- build: stable
|
|
|
|
os: ubuntu-latest
|
|
|
|
rust: stable
|
|
|
|
- build: beta
|
|
|
|
os: ubuntu-latest
|
|
|
|
rust: beta
|
|
|
|
- build: nightly
|
|
|
|
os: ubuntu-latest
|
|
|
|
rust: nightly
|
|
|
|
- build: macos
|
|
|
|
os: macos-latest
|
|
|
|
rust: stable
|
|
|
|
- build: windows
|
|
|
|
os: windows-latest
|
|
|
|
rust: stable
|
|
|
|
- build: msrv
|
2022-12-15 21:52:15 +08:00
|
|
|
os: ubuntu-20.04
|
2022-12-14 23:19:37 +08:00
|
|
|
# sync MSRV with docs: guide/src/guide/installation.md and Cargo.toml
|
2023-07-17 04:21:45 +08:00
|
|
|
rust: 1.66.0
|
2019-10-21 05:44:28 +08:00
|
|
|
steps:
|
2023-04-03 03:35:08 +08:00
|
|
|
- uses: actions/checkout@v3
|
2019-10-21 05:44:28 +08:00
|
|
|
- name: Install Rust
|
|
|
|
run: bash ci/install-rust.sh ${{ matrix.rust }}
|
|
|
|
- name: Build and run tests
|
2023-02-13 23:43:10 +08:00
|
|
|
run: cargo test --locked
|
2019-10-21 05:44:28 +08:00
|
|
|
- name: Test no default
|
|
|
|
run: cargo test --no-default-features
|
|
|
|
|
|
|
|
rustfmt:
|
|
|
|
name: Rustfmt
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-04-03 03:35:08 +08:00
|
|
|
- uses: actions/checkout@v3
|
2019-10-21 05:44:28 +08:00
|
|
|
- name: Install Rust
|
|
|
|
run: rustup update stable && rustup default stable && rustup component add rustfmt
|
2022-01-14 08:01:42 +08:00
|
|
|
- run: cargo fmt --check
|