2022-01-22 21:11:37 +00:00
|
|
|
name: Rust fmt
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
fmt:
|
2022-01-22 21:13:15 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-01-22 21:11:37 +00:00
|
|
|
|
2022-01-22 21:13:15 +00:00
|
|
|
steps:
|
2022-01-22 21:11:37 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup GIT
|
|
|
|
run: |
|
|
|
|
git config --global user.name "MedzikUserBot"
|
|
|
|
git config --global user.email "rm99iv9s@duck.com"
|
|
|
|
|
2022-01-22 22:02:05 +00:00
|
|
|
- name: Setup Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
2022-01-22 21:11:37 +00:00
|
|
|
|
2022-01-22 22:02:05 +00:00
|
|
|
- name: cargo fmt
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all
|
|
|
|
|
|
|
|
- name: Commit changes
|
2022-01-22 21:11:37 +00:00
|
|
|
run: |
|
|
|
|
git add .
|
|
|
|
git diff-index --quiet HEAD || git commit -m "rustfmt"
|
|
|
|
|
|
|
|
- name: Push changes
|
|
|
|
uses: ad-m/github-push-action@b007e7b818e33b04afd056e4c4b57ba917145d7a
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: 'main'
|