From a7e91ab82591d776e70c944d6c5787198f7a94dc Mon Sep 17 00:00:00 2001 From: Stephen Kent Date: Thu, 21 Sep 2023 23:12:21 -0700 Subject: [PATCH] Add Github Actions workflow to run pre-commit --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..00a7e6c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: Test + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + Test: + name: pre-commit + runs-on: ubuntu-latest + steps: + - name: 💾 Check out repository + uses: actions/checkout@v3 + + - name: 🪝 Cache pre-commit hooks + uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: "pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') + }}" + + - name: ✨ Install pre-commit + shell: bash + run: python3 -m pip install pre-commit + + - name: 🔥 Test + run: pre-commit run --all-files + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false