From 99e0e4ed8b89e9407fe47c603ec3d0e7c740e54a Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:13:24 -0600 Subject: [PATCH] chore: fix autolint action (#155) --- .github/workflows/autofix.yml | 25 +++++++++++++++++++++++++ .github/workflows/test.yml | 9 --------- mise.toml | 3 +++ 3 files changed, 28 insertions(+), 9 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 0000000..15c2b01 --- /dev/null +++ b/.github/workflows/autofix.yml @@ -0,0 +1,25 @@ +name: autofix.ci +on: + workflow_call: + pull_request: + push: + branches: ["main"] +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + with: + shared-key: test + save-if: false + - uses: jdx/mise-action@v2 + - run: mise r autofix + - uses: autofix-ci/action@v1.3.1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a40f169..686542b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,18 +9,13 @@ concurrency: cancel-in-progress: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MISE_EXPERIMENTAL: 1 jobs: test: runs-on: ubuntu-latest - permissions: - contents: write steps: - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - uses: Swatinem/rust-cache@v2 with: shared-key: test @@ -29,7 +24,3 @@ jobs: - run: mise r build - run: mise r test - run: mise r lint - - run: "mise r render ::: lint-fix ::: snapshots" - if: ${{ always() }} - - if: ${{ github.ref_name != 'main' && always() }} - uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/mise.toml b/mise.toml index f32eee8..87862e5 100644 --- a/mise.toml +++ b/mise.toml @@ -12,6 +12,9 @@ gh = "latest" "cargo:git-cliff" = "latest" "npm:prettier" = "latest" +[tasks.autofix] +depends = ["render", "lint-fix", "snapshots"] + [tasks.build] sources = ['{cli/,}src/**/*.rs', '{cli/,}Cargo.toml'] outputs = ['target/debug/rtx']