From 3173529212562c427927df55cbbde6694eef799e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 15 Nov 2023 23:32:46 +0000 Subject: [PATCH] Add basic CI --- .github/workflows/ci.yml | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d0dd277 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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