Skip to content

Commit

Permalink
Update the CI configuration (#65)
Browse files Browse the repository at this point in the history
1. Avoid running duplicate checks for pull requests.
2. Bump actions/checkout to v4.
3. Add a formatting check, using rustfmt.
  • Loading branch information
dguo authored Jan 4, 2024
1 parent f12662c commit 0a344fe
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI

on: [push, pull_request]
on:
push:
branches:
- main
pull_request:

jobs:
build:
Expand All @@ -12,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -22,3 +26,14 @@ jobs:
run: cargo build --verbose
- name: Test the code
run: cargo test --verbose
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Check formatting
run: cargo fmt --check

0 comments on commit 0a344fe

Please sign in to comment.