From dc68a44ffe26261589df50c3fff5b4c2bcadd52d Mon Sep 17 00:00:00 2001 From: Dan Lindholm Date: Mon, 21 Oct 2024 10:19:05 +0200 Subject: [PATCH] add separate workflow for checks --- .github/workflows/checks.yml | 41 ++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 7 ++---- 2 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/checks.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..c409ea4 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,41 @@ +name: checks + +on: + push: + branches: [master] + pull_request: + branches: [master] + +concurrency: + group: checks-${{ github.head_ref }} + cancel-in-progress: true + +env: + PYTHONUNBUFFERED: "1" + FORCE_COLOR: "1" + +jobs: + run: + name: Run checks [Python ${{ matrix.python-version }}] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Hatch + run: pip install --upgrade hatch + + - name: Linting + run: hatch fmt --check + + - name: Type checking + run: hatch run types:check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d8a7900..a1c6db6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: test on: push: - branches: [main, master] + branches: [master] pull_request: - branches: [main, master] + branches: [master] concurrency: group: test-${{ github.head_ref }} @@ -48,9 +48,6 @@ jobs: - name: Install Hatch run: pip install --upgrade hatch - - name: Run static analysis - run: hatch fmt --check - - name: Run tests run: hatch test --python ${{ matrix.python-version }} --cover --randomize --parallel --retries 2 --retry-delay 1 env: