Merge pull request #117 from bittcrafter/dev/0.10.0 #171
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- dev/* | |
pull_request: | |
# If a new push on the PR is done, cancel the build | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
PROTOC_VERSION: 3.23.4 | |
RUSTFLAGS: "-D warnings" | |
jobs: | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt --all --check | |
clippy: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install protoc | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: protoc@${{ env.PROTOC_VERSION }} | |
- name: Install nasm on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
choco install nasm -y | |
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy --all-targets --all-features | |
tests: | |
name: Test ${{ matrix.os }} (rust ${{matrix.toolchain}}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
toolchain: | |
- "1.81.0" # minimum supported rust version | |
- stable | |
- nightly | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Install protoc | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: protoc@${{ env.PROTOC_VERSION }} | |
- name: Install nasm on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
choco install nasm -y | |
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH | |
- uses: Swatinem/rust-cache@v2 | |
- name: Execute tests | |
run: cargo test --workspace --all-features --all-targets | |
env: | |
RUST_BACKTRACE: full |