Skip to content

CI Build

CI Build #425

Workflow file for this run

---
name: CI Build
on:
push:
branches:
- '**'
paths:
- '**/*.rs'
- 'src/*'
- 'Cargo.*'
- '.github/workflows/build.yml'
pull_request:
branches:
- '**'
paths:
- '**/*.rs'
- 'src/*'
- 'Cargo.*'
- '.github/workflows/build.yml'
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
env:
RUSTFLAGS: '--deny warnings'
jobs:
format:
name: Rust Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust Toolchain setup
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Format Check
uses: mbrobbel/rustfmt-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
build-linux:
name: CI Build - Linux
runs-on: ubuntu-latest
needs: format
strategy:
matrix:
RUST: [stable]
TARGET:
- x86_64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust Toolchain setup
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.RUST }}
target: ${{ matrix.TARGET }}
- name: Cross setup
run: cargo install cross
- name: Build
run: cross build --target=${{ matrix.TARGET }}
- name: Test
run: cross test --target=${{ matrix.TARGET }}
build-macos:
name: CI Build - Macos
runs-on: macos-latest
needs: format
strategy:
matrix:
RUST: [stable]
TARGET:
- x86_64-apple-darwin
- aarch64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust Toolchain setup
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.RUST }}
target: ${{ matrix.TARGET }}
- name: Cross setup
run: cargo install cross
- name: Build
run: cross build --target=${{ matrix.TARGET }}
- name: Test
run: cargo test