Skip to content

Commit 955b872

Browse files
authored
Optimize GitHub Actions (#118)
This optimizes and speeds up tests a bit by doing the following: - upgrades Actions' versions - sets cache dir name from setup.cfg instead of setup.py - excludes configurations where no tests are run (for example, py36-dj40) Closes #116
2 parents 493cb0c + 61bc298 commit 955b872

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515
with:
1616
fetch-depth: 0
1717

1818
- name: Set up Python
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: 3.8
2222

.github/workflows/test.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,46 @@ jobs:
1111
matrix:
1212
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
1313
django-version: ['3.2', '4.0', '4.1', 'main']
14+
exclude:
15+
- django-version: '3.2'
16+
python-version: '3.11'
17+
18+
- django-version: '4.0'
19+
python-version: '3.6'
20+
- django-version: '4.0'
21+
python-version: '3.7'
22+
- django-version: '4.0'
23+
python-version: '3.11'
24+
25+
- django-version: '4.1'
26+
python-version: '3.6'
27+
- django-version: '4.1'
28+
python-version: '3.7'
29+
30+
- django-version: 'main'
31+
python-version: '3.6'
32+
- django-version: 'main'
33+
python-version: '3.7'
1434

1535
steps:
16-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v3
1737

1838
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
39+
uses: actions/setup-python@v4
2040
with:
2141
python-version: ${{ matrix.python-version }}
2242

2343
- name: Get pip cache dir
2444
id: pip-cache
2545
run: |
26-
echo "::set-output name=dir::$(pip cache dir)"
46+
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
2747
2848
- name: Cache
29-
uses: actions/cache@v2
49+
uses: actions/cache@v3
3050
with:
3151
path: ${{ steps.pip-cache.outputs.dir }}
3252
key:
33-
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
53+
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
3454
restore-keys: |
3555
${{ matrix.python-version }}-v1-
3656
@@ -46,6 +66,6 @@ jobs:
4666
DJANGO: ${{ matrix.django-version }}
4767

4868
- name: Upload coverage
49-
uses: codecov/codecov-action@v1
69+
uses: codecov/codecov-action@v3
5070
with:
5171
name: Python ${{ matrix.python-version }}

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ DJANGO =
2626
usedevelop = true
2727
deps =
2828
coverage
29-
dj32: Django>=3.2,<3.3
30-
dj40: Django>=4.0,<4.1
31-
dj41: Django>=4.1,<4.2
29+
dj32: Django~=3.2.16
30+
dj40: Django~=4.0.8
31+
dj41: Django~=4.1.2
3232
djmain: https://github.com/django/django/tarball/main
3333
setenv =
3434
DJANGO_SETTINGS_MODULE=simple_menu.test_settings

0 commit comments

Comments
 (0)