From a090e25766b604ade88ee03dbc96168c4c85fdb2 Mon Sep 17 00:00:00 2001 From: Leonard Lesinski <84378319+Le0X8@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:01:13 +0200 Subject: [PATCH] Added automated code formatting --- .github/workflows/rustfmt.yml | 24 ++++++++++++++++++++++++ .github/workflows/tests.yml | 27 +++++++++++++-------------- .vscode/settings.json | 2 +- 3 files changed, 38 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/rustfmt.yml diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml new file mode 100644 index 0000000..597f0d2 --- /dev/null +++ b/.github/workflows/rustfmt.yml @@ -0,0 +1,24 @@ +name: Automated Code Formatting + +on: + push: + branches: + - "*" + - "*/*" + - "**" + +jobs: + format: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - uses: mbrobbel/rustfmt-check@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + mode: pull diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d7a102f..eb3cb7e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,19 +1,18 @@ name: Run integration tests on: [push, pull_request] env: - CARGO_TERM_COLOR: always + CARGO_TERM_COLOR: always jobs: - test: + test: + runs-on: ubuntu-latest - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose \ No newline at end of file + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose diff --git a/.vscode/settings.json b/.vscode/settings.json index e3f3c6c..68ebc15 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "editor.tabSize": 4 + "editor.tabSize": 4 } \ No newline at end of file