1
- name : CI
1
+ name : Run tests and pretty files
2
2
on :
3
3
push :
4
- branches :
5
- - main
6
- tags-ignore :
7
- - ' **'
4
+ branches : [main]
5
+ tags-ignore : ['**']
8
6
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'
10
12
- ' python_weather/**/*.py'
11
- pull_request : null
12
13
jobs :
13
- ci :
14
- name : Run tests and pretty files
14
+ test :
15
15
runs-on : ubuntu-latest
16
+ strategy :
17
+ matrix :
18
+ python-version : [3.9, '3.10', 3.11, 3.12, 3.13]
16
19
steps :
17
20
- uses : actions/checkout@v4
18
21
with :
@@ -22,31 +25,30 @@ jobs:
22
25
shell : bash
23
26
- uses : actions/setup-python@v5
24
27
with :
25
- python-version : ' 3.9 '
28
+ python-version : ${{ matrix.python-version }}
26
29
architecture : x64
27
30
- name : Install dependencies
28
31
run : python3 -m pip install .
29
- - name : Run test
32
+ - name : Run tests
30
33
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 }}
32
39
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
40
42
- name : Import GPG key
41
- if : ${{ github.event_name != 'pull_request' }}
43
+ if : ${{ github.event_name != 'pull_request' && matrix.python-version == 3.13 }}
42
44
uses : crazy-max/ghaction-import-gpg@v6
43
45
with :
44
46
gpg_private_key : ${{ secrets.CI_GPG_PRIVATE_KEY }}
45
47
passphrase : ${{ secrets.CI_GPG_PASS }}
46
48
git_user_signingkey : true
47
49
git_commit_gpgsign : true
48
50
- name : Commit changes
49
- if : ${{ github.event_name != 'pull_request' }}
51
+ if : ${{ github.event_name != 'pull_request' && matrix.python-version == 3.13 }}
50
52
uses : EndBug/add-and-commit@v9
51
53
with :
52
54
commit : -S
0 commit comments