summaryrefslogtreecommitdiff
path: root/.github/workflows/format.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/format.yaml')
-rw-r--r--.github/workflows/format.yaml47
1 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml
new file mode 100644
index 0000000..b0eaddd
--- /dev/null
+++ b/.github/workflows/format.yaml
@@ -0,0 +1,47 @@
+name: format project
+
+on:
+ workflow_call:
+ workflow_dispatch:
+
+permissions:
+ contents: write
+
+jobs:
+ cargo-fmt:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ components: clippy
+
+ - name: run cargo fmt
+ uses: actions-rs/cargo@v1
+ with:
+ command: fmt
+ args: --all
+
+ - uses: EndBug/add-and-commit@v9
+ with:
+ default_author: github_actions
+ message: "chore: fmt rust files"
+
+ nix-fmt:
+ runs-on: ubuntu-latest
+ needs: cargo-fmt
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: cachix/install-nix-action@v21
+
+ - run: nix fmt
+
+ - uses: EndBug/add-and-commit@v9
+ with:
+ default_author: github_actions
+ message: "chore: fmt nix files"