Closed thavlik closed 5 months ago
@patsevanton This ended up being simpler than expected. For reference, all this required was adding the workflow file .github/workflows/rustfmt.yml
, and GitHub does the rest:
name: Check formatting with rustfmt
run-name: Ensure rustfmt check passes
on: [push]
jobs:
Check-Formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install rustfmt
run: sudo apt-get update && sudo apt-get install -y rustfmt
- name: Check vpn-types subcrate formatting
run: rustfmt --edition 2021 --check $GITHUB_WORKSPACE/types/src/lib.rs
- name: Check vpn-operator subcrate formatting
run: rustfmt --edition 2021 --check $GITHUB_WORKSPACE/operator/src/main.rs
Implement a GitHub Action that verifies consistent formatting with
rustfmt
.