Skip to content

Commit fc377cd

Browse files
authored
chore: add PR checks (#5)
1 parent 5e23df2 commit fc377cd

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/pr-checks.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: PR checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
15+
with:
16+
ref: ${{ github.head_ref }}
17+
- name: Install Rust toolchain
18+
uses: dtolnay/rust-toolchain@stable
19+
- name: Cargo fmt
20+
run: |
21+
cargo fmt
22+
git config --global user.name 'cargofmt robot'
23+
git diff --quiet && git diff --staged --quiet || git commit -am "chore: rustfmt"
24+
git push
25+
- name: Cargo test
26+
run: |
27+
cargo test

0 commit comments

Comments
 (0)