Skip to content

Commit 178116f

Browse files
authored
Update to newer GH Actions versions and split jobs (#72)
* Update to newer GH Actions versions * Move sphinx docs GH Action to it's own to allow parallelization * Split out linting * Avoid duplicate GH Actions runs for PRs * Run lint and docs on pull_request and push
1 parent b7aa589 commit 178116f

File tree

4 files changed

+55
-20
lines changed

4 files changed

+55
-20
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v2
33+
uses: actions/checkout@v4
3434
with:
3535
# We must fetch at least the immediate parents so that if this is
3636
# a pull request then we can checkout the head.
@@ -43,7 +43,7 @@ jobs:
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
46+
uses: github/codeql-action/init@v3
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
57+
uses: github/codeql-action/autobuild@v3
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
71+
uses: github/codeql-action/analyze@v3

.github/workflows/docs.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: sphinxdocs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
19+
- name: Docs and Doctests
20+
# Only check docs on single version
21+
run: |
22+
make docs

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.12"
19+
20+
- name: Check code formatting
21+
run: |
22+
make lint

.github/workflows/test.yaml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
name: Python package
1+
name: tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
47

58
env:
69
primary-python-version: "3.12"
@@ -14,7 +17,7 @@ jobs:
1417
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1518

1619
steps:
17-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1821
- name: Set up Python ${{ matrix.python-version }}
1922
uses: actions/setup-python@v5
2023
with:
@@ -34,21 +37,9 @@ jobs:
3437
run: |
3538
make coverage
3639
37-
- name: Check code formatting
38-
if: matrix.python-version == env.primary-python-version
39-
# Includes flake8, black --check, and isort --check-only
40-
run: |
41-
make lint
42-
4340
- name: Upload to codecov.io
4441
# Only upload coverage report for single version
4542
if: matrix.python-version == env.primary-python-version
46-
uses: codecov/codecov-action@v1.0.5
43+
uses: codecov/codecov-action@v4
4744
with:
4845
token: ${{ secrets.CODECOV_TOKEN }}
49-
50-
- name: Docs and Doctests
51-
# Only check docs on single version
52-
if: matrix.python-version >= env.primary-python-version
53-
run: |
54-
make docs

0 commit comments

Comments
 (0)