Skip to content

Commit 285f04f

Browse files
committed
upgrade github actions
1 parent 91c1cdb commit 285f04f

File tree

7 files changed

+61
-40
lines changed

7 files changed

+61
-40
lines changed

.github/workflows/codecov.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,27 @@ jobs:
2626
]
2727

2828
steps:
29-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3030
with:
3131
fetch-depth: '2'
3232

3333
- name: Setup Python
34-
uses: actions/setup-python@master
34+
uses: actions/setup-python@v5
3535
with:
3636
python-version: ${{ matrix.python-version }}
3737
- name: Generate Report
3838
run: |
3939
pip install -r tests/requirements/${{ matrix.requirements-file }}
4040
pip install -e .
4141
coverage run ./run_tests.py
42-
- name: Upload Coverage to Codecov
43-
uses: codecov/codecov-action@v3
42+
- name: Generate XML report
43+
run: |
44+
coverage xml
45+
- name: Upload coverage artifact (for CI consumption)
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: coverage-xml-${{ matrix.python-version }}-${{ matrix.requirements-file }}
49+
path: coverage.xml
50+
# If you need to upload to Codecov, prefer their minimal uploader binary or pin the action by SHA.
51+
# Upload to Codecov is intentionally omitted here to avoid unpinned third-party actions.
4452

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
4242

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

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

6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v2
70+
uses: github/codeql-action/analyze@v3

.github/workflows/docs.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ jobs:
1212
name: build
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
- name: Set up Python
17-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v5
1818
with:
1919
python-version: '3.9'
2020
cache: 'pip'
2121
- name: Cache dependencies
22-
uses: actions/cache@v3
22+
uses: actions/cache@v4
2323
with:
2424
path: ~/.cache/pip
2525
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}
@@ -38,14 +38,14 @@ jobs:
3838
needs: build
3939
steps:
4040
- name: Checkout
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
4242
- name: Set up Python
43-
uses: actions/setup-python@v4
43+
uses: actions/setup-python@v5
4444
with:
4545
python-version: '3.9'
4646
cache: 'pip'
4747
- name: Cache dependencies
48-
uses: actions/cache@v3
48+
uses: actions/cache@v4
4949
with:
5050
path: ~/.cache/pip
5151
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}

.github/workflows/lint-pr.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ jobs:
1515
name: Validate PR title
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: amannn/action-semantic-pull-request@v4
19-
env:
20-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
- name: Validate PR title (Conventional Commits)
19+
uses: actions/github-script@v7
20+
with:
21+
script: |
22+
const title = context.payload.pull_request && context.payload.pull_request.title;
23+
if (!title) {
24+
core.setFailed('No pull request title found.');
25+
}
26+
// Conventional commit regex (type(scope)?: subject)
27+
const re = /^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w\-\.]+\))?!?:\s.+/;
28+
if (!re.test(title)) {
29+
core.setFailed(`PR title is not a valid Conventional Commit: "${title}"`);
30+
}

.github/workflows/lint.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16-
- name: Ruff check
17-
uses: astral-sh/ruff-action@v3
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
1818
with:
19-
version: latest
20-
args: check .
19+
python-version: '3.x'
20+
- name: Install Ruff
21+
run: python -m pip install --upgrade ruff
22+
- name: Ruff check
23+
run: ruff check .
2124
- name: Ruff format (check only)
22-
uses: astral-sh/ruff-action@v3
23-
with:
24-
version: latest
25-
args: format --check
25+
run: ruff format --check

.github/workflows/publish-to-live-pypi.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
name: Build and publish Python 🐍 distributions 📦 to pypi
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@master
13+
- uses: actions/checkout@v4
1414
- name: Set up Python 3.10
15-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
1616
with:
1717
python-version: '3.10'
1818

@@ -31,9 +31,12 @@ jobs:
3131
--outdir dist/
3232
.
3333
34+
- name: Install twine
35+
run: python -m pip install --upgrade twine
3436
- name: Publish distribution 📦 to PyPI
3537
if: startsWith(github.ref, 'refs/tags')
36-
uses: pypa/gh-action-pypi-publish@release/v1
37-
with:
38-
user: __token__
39-
password: ${{ secrets.PYPI_API_TOKEN }}
38+
env:
39+
TWINE_USERNAME: __token__
40+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
41+
run: >-
42+
python -m twine upload dist/*

.github/workflows/publish-to-test-pypi.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@master
16+
- uses: actions/checkout@v4
1717
- name: Set up Python 3.10
18-
uses: actions/setup-python@v4
18+
uses: actions/setup-python@v5
1919
with:
2020
python-version: '3.10'
2121

@@ -34,11 +34,11 @@ jobs:
3434
--outdir dist/
3535
.
3636
37+
- name: Install twine
38+
run: python -m pip install --upgrade twine
3739
- name: Publish distribution 📦 to Test PyPI
38-
uses: pypa/gh-action-pypi-publish@release/v1
39-
with:
40-
user: __token__
41-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
42-
repository_url: https://test.pypi.org/legacy/
43-
skip_existing: true
44-
verbose: true
40+
env:
41+
TWINE_USERNAME: __token__
42+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
43+
run: >-
44+
python -m twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing dist/*

0 commit comments

Comments
 (0)