Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce GitHub Actions workflow for linting and building #1

Merged
merged 3 commits into from
Mar 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint and build

on:
push:
pull_request:
branches:
- main

jobs:
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Install Rust toolchain (rustfmt)
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check format
run: cargo fmt --all -- --check

test:
name: Build and test
strategy:
matrix:
os: [ubuntu-latest]
toolchain: [stable, nightly]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Install Rust toolchain ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
- name: Run tests
run: cargo test --release -vv