From d71f4f74cb3179473b736fc14b7c1b2538eed97a Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Fri, 25 Oct 2024 12:28:37 +0200 Subject: [PATCH] Add workflow for linting / code style (#97) * Add CI for linting / code style * Test for python 3.12 --- .github/workflows/code-style.yaml | 33 +++++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/code-style.yaml diff --git a/.github/workflows/code-style.yaml b/.github/workflows/code-style.yaml new file mode 100644 index 00000000..62a58a18 --- /dev/null +++ b/.github/workflows/code-style.yaml @@ -0,0 +1,33 @@ +name: Code style + +on: + push: + branches: + - main + pull_request: + branches: + - main + types: + - opened + - reopened + - synchronize + - ready_for_review + workflow_dispatch: + +jobs: + codestyle: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v45 + + - name: Run Pre-Commit + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + uses: pre-commit/action@v3.0.1 + with: + extra_args: --files $ALL_CHANGED_FILES diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ba97346..b5abadd7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3