Skip to content

Commit 6ee072e

Browse files
committed
ci: test every python version prior to 3.13 [skip ci]
1 parent 9cecf24 commit 6ee072e

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

.github/workflows/changelog.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
name: Update changelog.rst
22
on:
33
push:
4-
branches:
5-
- main
6-
tags-ignore:
7-
- '**'
8-
paths:
9-
- changelog.yml
4+
branches: [main]
5+
tags-ignore: ['**']
6+
paths: [changelog.yml]
107
jobs:
118
changelog:
12-
name: Update changelog.rst
139
runs-on: ubuntu-latest
1410
steps:
1511
- uses: actions/checkout@v4
@@ -20,7 +16,7 @@ jobs:
2016
shell: bash
2117
- uses: actions/setup-python@v5
2218
with:
23-
python-version: '3.13'
19+
python-version: 3.13
2420
architecture: x64
2521
- name: Install dependencies
2622
run: python3 -m pip install pyyaml

.github/workflows/CI.yml renamed to .github/workflows/test.yml

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
name: CI
1+
name: Run tests and pretty files
22
on:
33
push:
4-
branches:
5-
- main
6-
tags-ignore:
7-
- '**'
4+
branches: [main]
5+
tags-ignore: ['**']
86
paths:
9-
- '.github/workflows/CI.yml'
7+
- '.github/workflows/test.yml'
8+
- 'python_weather/**/*.py'
9+
pull_request:
10+
paths:
11+
- '.github/workflows/test.yml'
1012
- 'python_weather/**/*.py'
11-
pull_request: null
1213
jobs:
13-
ci:
14-
name: Run tests and pretty files
14+
test:
1515
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.9, '3.10', 3.11, 3.12, 3.13]
1619
steps:
1720
- uses: actions/checkout@v4
1821
with:
@@ -22,31 +25,30 @@ jobs:
2225
shell: bash
2326
- uses: actions/setup-python@v5
2427
with:
25-
python-version: '3.9'
28+
python-version: ${{ matrix.python-version }}
2629
architecture: x64
2730
- name: Install dependencies
2831
run: python3 -m pip install .
29-
- name: Run test
32+
- name: Run tests
3033
run: python3 test.py
31-
- name: Install yapf
34+
- name: Install dev dependencies
35+
if: ${{ github.event_name != 'pull_request' && matrix.python-version == 3.13 }}
36+
run: python3 -m pip install ruff
37+
- name: Lint and pretty files
38+
if: ${{ github.event_name != 'pull_request' && matrix.python-version == 3.13 }}
3239
run: |
33-
python3 -m pip install toml
34-
python3 -m pip install ruff
35-
- name: Lint files
36-
run: python3 -m ruff check
37-
- name: Pretty files
38-
if: ${{ github.event_name != 'pull_request' }}
39-
run: python3 -m ruff format
40+
python3 -m ruff check
41+
python3 -m ruff format
4042
- name: Import GPG key
41-
if: ${{ github.event_name != 'pull_request' }}
43+
if: ${{ github.event_name != 'pull_request' && matrix.python-version == 3.13 }}
4244
uses: crazy-max/ghaction-import-gpg@v6
4345
with:
4446
gpg_private_key: ${{ secrets.CI_GPG_PRIVATE_KEY }}
4547
passphrase: ${{ secrets.CI_GPG_PASS }}
4648
git_user_signingkey: true
4749
git_commit_gpgsign: true
4850
- name: Commit changes
49-
if: ${{ github.event_name != 'pull_request' }}
51+
if: ${{ github.event_name != 'pull_request' && matrix.python-version == 3.13 }}
5052
uses: EndBug/add-and-commit@v9
5153
with:
5254
commit: -S

0 commit comments

Comments
 (0)