From acd901d3b6fa3f9f6e7e07ab0a5885b151deafe2 Mon Sep 17 00:00:00 2001 From: Paul Balanca Date: Tue, 7 Nov 2023 14:33:58 +0000 Subject: [PATCH] Adding `pre-commit` Github action. --- .github/workflows/tests.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..85c7060 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,31 @@ +name: tests + +env: + GIT_MAIN_BRANCH: "main" + +# Controls when the workflow will run. +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab. + workflow_dispatch: + +jobs: + lint_and_typecheck: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Cancel previous + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + if: ${{github.ref != 'refs/head/main'}} + - uses: actions/checkout@v3 + - name: Set up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - uses: pre-commit/action@v3.0.0