2021-10-09 15:38:01 +00:00
|
|
|
#
|
|
|
|
# Configuration for GitHub-based CI, based on the stock GitHub Rust config.
|
|
|
|
#
|
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check-style:
|
2022-07-27 04:06:31 +00:00
|
|
|
runs-on: ubuntu-latest
|
2021-10-09 15:38:01 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-07-03 02:09:38 +00:00
|
|
|
- name: Install nightly
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
components: rustfmt
|
|
|
|
default: false
|
|
|
|
- name: Install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
components: rustfmt
|
|
|
|
default: true
|
2021-10-09 15:38:01 +00:00
|
|
|
- name: Report cargo version
|
|
|
|
run: cargo --version
|
|
|
|
- name: Report rustfmt version
|
|
|
|
run: cargo fmt -- --version
|
2022-07-03 02:09:38 +00:00
|
|
|
- name: Report nightly cargo version
|
|
|
|
run: cargo +nightly --version
|
|
|
|
- name: Report nightly rustfmt version
|
|
|
|
run: cargo +nightly fmt -- --version
|
2021-10-09 15:38:01 +00:00
|
|
|
- name: Check style
|
|
|
|
run: cargo fmt -- --check
|
|
|
|
|
|
|
|
build-and-test:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-07-27 04:06:31 +00:00
|
|
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
2021-10-09 15:38:01 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-07-03 02:09:38 +00:00
|
|
|
- name: Install nightly
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
components: rustfmt
|
|
|
|
default: false
|
|
|
|
- name: Install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
components: rustfmt
|
|
|
|
default: true
|
2021-10-09 15:38:01 +00:00
|
|
|
- name: Build
|
2023-01-11 22:19:55 +00:00
|
|
|
run: cargo build --locked --tests --verbose
|
2021-10-09 15:38:01 +00:00
|
|
|
- name: Run tests
|
2023-01-11 22:19:55 +00:00
|
|
|
run: cargo test --locked --verbose
|