Skip to content

Commit

Permalink
ci: add CI and pin toolchain (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC authored Oct 4, 2024
1 parent 651a486 commit f250aa0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
pull_request:
push:
branches:
- main

name: CI

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run cargo fmt
env:
TERM: xterm-256color
run: |
cargo fmt --all -- --check
main:
needs: fmt
name: ${{ matrix.runs_on }} (clippy, test)
runs-on: ${{ matrix.runs_on }}
strategy:
fail-fast: false
matrix:
include:
- runs_on: macos-latest
- runs_on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run cargo clippy
run: cargo clippy -- -D warnings

- name: Run cargo test
run: cargo test
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.76.0"

0 comments on commit f250aa0

Please sign in to comment.