@@ -2,53 +2,61 @@ name: Python Package Workflow
22
33on :
44 push :
5- branches : [ master ]
5+ branches :
6+ - master
67 pull_request :
7- branches : [ master ]
8+ branches :
9+ - master
810
911jobs :
1012 build :
1113
12- runs-on : ubuntu-latest
14+ runs-on : ubuntu-24.04
1315 strategy :
1416 matrix :
1517 python-version : ["3.11", "3.12", "3.13"]
1618
1719 steps :
18- - uses : actions/checkout@v3
19- - name : Set up Python ${{ matrix.python-version }}
20- uses : actions/setup-python@v4
21- with :
22- python-version : ${{ matrix.python-version }}
23- - name : Install dependencies
24- run : |
25- python -m pip install --upgrade pip
26- pip install -r requirements.txt
27- - name : Cache pip dependencies
28- uses : actions/cache@v3
29- with :
30- path : ~/.cache/pip # This path is specific to Ubuntu
31- # Check for a cache hit for the corresponding dev requirements file
32- key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
33- restore-keys : |
34- ${{ runner.os }}-pip-
35- ${{ runner.os }}-
36- - name : Generate example project
37- run : |
38- cookiecutter --no-input . package_name=example
39- - name : Check example project
40- run : |
41- cd example
42- make venv
43- . venv/bin/activate
44- make help
45- make style
46- make check-style
47- make check-static-analysis
48- make test
49- make test-verbose
50- make coverage
51- make check-docs
52- make docs
53- make dist
54- make dist-test
20+ - uses : actions/checkout@v4
21+
22+ - name : Set up Python ${{ matrix.python-version }}
23+ uses : actions/setup-python@v5
24+ with :
25+ python-version : ${{ matrix.python-version }}
26+
27+ - name : Install Hatch
28+ uses : pypa/hatch@install
29+
30+ - name : Install dependencies
31+ run : |
32+ python -m pip install --upgrade pip
33+ pip install -r requirements.txt
34+
35+ - name : Cache pip dependencies
36+ uses : actions/cache@v4
37+ with :
38+ path : ~/.cache/pip # This path is specific to Ubuntu
39+ # Check for a cache hit for the corresponding dev requirements file
40+ key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
41+ restore-keys : |
42+ ${{ runner.os }}-pip-
43+ ${{ runner.os }}-
44+
45+ - name : Generate example project
46+ run : |
47+ cookiecutter --no-input . package_name=example
48+
49+ - name : Check example project
50+ run : |
51+ cd example
52+ make help
53+ make style
54+ make check-style
55+ make check-static-analysis
56+ make test
57+ make test-verbose
58+ make coverage
59+ make check-docs
60+ make docs
61+ make dist
62+ make dist-test
0 commit comments