2019-10-21 05:44:28 +08:00
|
|
|
name: CI
|
|
|
|
on:
|
|
|
|
# Only run when merging to master, or open/synchronize/reopen a PR.
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
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
|
|
|
|
rust: 1.60.0
|
2019-10-21 05:44:28 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- 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:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- 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
|