Add basic CI

This commit is contained in:
Jack Grigg 2023-11-15 23:32:46 +00:00
parent 1f839cd253
commit 3173529212
1 changed files with 54 additions and 0 deletions

54
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,54 @@
name: CI checks
on: [push, pull_request]
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
- name: Build binary
run: cargo build
- name: Verify working directory is clean
run: git diff --exit-code
build-latest:
name: Build latest on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
- name: Remove lockfile to build with latest dependencies
run: rm Cargo.lock
- name: Build binary
run: cargo build
- name: Verify working directory is clean (excluding lockfile)
run: git diff --exit-code ':!Cargo.lock'
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Clippy
uses: auguwu/clippy-action@1.3.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{ inputs.target }}
deny: warnings
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt --all -- --check