From 9835e4821a4ceb7aa9aa8bdeca61623a726a3f14 Mon Sep 17 00:00:00 2001 From: John Paulett Date: Fri, 6 Jun 2025 21:29:09 -0400 Subject: [PATCH 1/5] Update to newer GH Actions versions --- .github/workflows/codeql-analysis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 67c4c5d..ffbf222 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. @@ -43,7 +43,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -54,7 +54,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -68,4 +68,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v3 From ffc51bdb2b9003725fa6bdf40ba1ebe3a65c8436 Mon Sep 17 00:00:00 2001 From: John Paulett Date: Fri, 6 Jun 2025 21:32:31 -0400 Subject: [PATCH 2/5] Move sphinx docs GH Action to it's own to allow parallelization --- .github/workflows/docs.yml | 19 +++++++++++++++++++ .github/workflows/test.yaml | 10 ++-------- 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..cfa27a7 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,19 @@ +name: sphinxdocs + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Docs and Doctests + # Only check docs on single version + run: | + make docs diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6414dc7..6e0f23b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,7 +14,7 @@ jobs: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -43,12 +43,6 @@ jobs: - name: Upload to codecov.io # Only upload coverage report for single version if: matrix.python-version == env.primary-python-version - uses: codecov/codecov-action@v1.0.5 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - - - name: Docs and Doctests - # Only check docs on single version - if: matrix.python-version >= env.primary-python-version - run: | - make docs From 1249ab31c3aaecd3f90a587dd06ab14c3d1792fb Mon Sep 17 00:00:00 2001 From: John Paulett Date: Fri, 6 Jun 2025 21:34:30 -0400 Subject: [PATCH 3/5] Split out linting --- .github/workflows/lint.yml | 19 +++++++++++++++++++ .github/workflows/test.yaml | 8 +------- 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..76b4bd0 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,19 @@ +name: lint + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Check code formatting + run: | + make lint \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6e0f23b..f5a9258 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,4 +1,4 @@ -name: Python package +name: tests on: [push, pull_request] @@ -34,12 +34,6 @@ jobs: run: | make coverage - - name: Check code formatting - if: matrix.python-version == env.primary-python-version - # Includes flake8, black --check, and isort --check-only - run: | - make lint - - name: Upload to codecov.io # Only upload coverage report for single version if: matrix.python-version == env.primary-python-version From 4f79de15e3fe95bf8c188e21ca1c8e905a090187 Mon Sep 17 00:00:00 2001 From: John Paulett Date: Fri, 6 Jun 2025 21:46:22 -0400 Subject: [PATCH 4/5] Avoid duplicate GH Actions runs for PRs --- .github/workflows/test.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f5a9258..9c0e118 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,9 @@ name: tests -on: [push, pull_request] +on: + push: + branches: [main] + pull_request: env: primary-python-version: "3.12" From 53c041941e9101960db5ed6bb4ba68c55bad9359 Mon Sep 17 00:00:00 2001 From: John Paulett Date: Fri, 6 Jun 2025 21:48:03 -0400 Subject: [PATCH 5/5] Run lint and docs on pull_request and push --- .github/workflows/docs.yml | 5 ++++- .github/workflows/lint.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cfa27a7..02b4706 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,6 +1,9 @@ name: sphinxdocs -on: [pull_request] +on: + push: + branches: [main] + pull_request: jobs: build: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 76b4bd0..82dced7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,9 @@ name: lint -on: [pull_request] +on: + push: + branches: [main] + pull_request: jobs: build: