From 66c0b3539f74d308eb09e09dc2e06937384182d0 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:37:57 -0600 Subject: [PATCH] chore: fix autofix PR action --- .github/workflows/autofix.yml | 48 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 20 --------------- 2 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/autofix.yml diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml new file mode 100644 index 000000000..5afdca318 --- /dev/null +++ b/.github/workflows/autofix.yml @@ -0,0 +1,48 @@ +name: autofix.ci + +on: + workflow_call: + pull_request: + push: + branches: ["main"] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 0 + MISE_TRUSTED_CONFIG_PATHS: ${{ github.workspace }} + MISE_EXPERIMENTAL: 1 + RUST_BACKTRACE: 1 + NPM_CONFIG_FUND: false + +jobs: + nightly: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + { toolchain: nightly, components: "rustfmt, clippy", rustflags: "" } + - run: | + cargo build --all-features + echo "$PWD/target/debug" >> "$GITHUB_PATH" + - name: cache mise + uses: actions/cache@v4 + with: + key: mise-tools-ubuntu-latest-${{ hashFiles('.mise.toml') }} + restore-keys: mise-tools-ubuntu-latest + path: | + ~/.local/share/mise/installs + ~/.local/share/mise/plugins + - run: mise install + - run: npm install + - run: "mise run snapshots ::: lint-fix ::: render && git diff HEAD" + - uses: autofix-ci/action@v1.3.1 + if: ${{ always() }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 35340c85e..af92dc271 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,23 +61,8 @@ jobs: - run: cargo msrv verify - run: cargo machete --with-metadata - run: ./scripts/test-standalone.sh - - run: mise settings set experimental true - if: ${{ always() }} - - run: mise run render - if: ${{ always() }} - uses: actions-rust-lang/rustfmt@v1 - if: ${{ always() }} - run: mise run lint - if: ${{ always() }} - - run: mise run snapshots - if: ${{ always() }} - - run: mise run lint-fix && git diff HEAD - if: ${{ always() }} - - uses: stefanzweifel/git-auto-commit-action@v5 - if: ${{ always() }} - with: - commit_author: mise[bot] <123107610+mise-en-dev@users.noreply.github.com> - commit_message: "chore: apply lint fixes" nightly: runs-on: ubuntu-latest @@ -104,11 +89,6 @@ jobs: ~/.local/share/mise/plugins - run: mise install - run: mise run test:shuffle - - run: mise run lint-fix && git diff HEAD - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_author: mise[bot] <123107610+mise-en-dev@users.noreply.github.com> - commit_message: "chore: apply lint fixes" coverage: name: coverage-${{matrix.tranche}}