Skip to content

Commit

Permalink
chore: Introduce GitHub Actions workflow for linting and building (#1)
Browse files Browse the repository at this point in the history
* chore: add GitHub Actions workflow to lint and build

`.github/workflows/build.yml` runs `rustfmt` and `cargo test` when
commits are pushed to the repository, or a PR is made to `main` branch.
  • Loading branch information
kikuomax authored Mar 3, 2024
1 parent 0ece841 commit 8245639
Showing 1 changed file with 38 additions and 0 deletions.
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

0 comments on commit 8245639

Please sign in to comment.