Skip to content

Commit 8e39e00

Browse files
committed
Upgrade GitHub Actions workflows
1 parent 7ecb595 commit 8e39e00

File tree

2 files changed

+27
-35
lines changed

2 files changed

+27
-35
lines changed

.github/workflows/publish.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,40 @@ on:
44
release:
55
types: [created]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
test:
912
runs-on: ubuntu-latest
1013
strategy:
1114
matrix:
12-
python-version: ["3.7", "3.8", "3.9", "3.10"]
15+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
1316
steps:
14-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1518
- name: Set up Python ${{ matrix.python-version }}
16-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
1720
with:
1821
python-version: ${{ matrix.python-version }}
19-
- uses: actions/cache@v2
20-
name: Configure pip caching
21-
with:
22-
path: ~/.cache/pip
23-
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
24-
restore-keys: |
25-
${{ runner.os }}-pip-
22+
cache: pip
23+
cache-dependency-path: setup.py
2624
- name: Install dependencies
2725
run: |
28-
pip install -e '.[test]'
26+
pip install '.[test]'
2927
- name: Run tests
3028
run: |
31-
pytest -vv
29+
pytest
3230
deploy:
3331
runs-on: ubuntu-latest
3432
needs: [test]
3533
steps:
36-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v3
3735
- name: Set up Python
38-
uses: actions/setup-python@v2
36+
uses: actions/setup-python@v4
3937
with:
40-
python-version: '3.10'
41-
- uses: actions/cache@v2
42-
name: Configure pip caching
43-
with:
44-
path: ~/.cache/pip
45-
key: ${{ runner.os }}-publish-pip-${{ hashFiles('**/setup.py') }}
46-
restore-keys: |
47-
${{ runner.os }}-publish-pip-
38+
python-version: "3.11"
39+
cache: pip
40+
cache-dependency-path: setup.py
4841
- name: Install dependencies
4942
run: |
5043
pip install setuptools wheel twine build
@@ -55,3 +48,4 @@ jobs:
5548
run: |
5649
python -m build
5750
twine upload dist/*
51+

.github/workflows/test.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
11
name: Test
22

3-
on: [push]
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
47

58
jobs:
69
test:
710
runs-on: ubuntu-latest
811
strategy:
912
matrix:
10-
python-version: ["3.7", "3.8", "3.9", "3.10"]
13+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
1114
steps:
12-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1316
- name: Set up Python ${{ matrix.python-version }}
14-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1518
with:
1619
python-version: ${{ matrix.python-version }}
17-
- uses: actions/cache@v2
18-
name: Configure pip caching
19-
with:
20-
path: ~/.cache/pip
21-
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
22-
restore-keys: |
23-
${{ runner.os }}-pip-
20+
cache: pip
21+
cache-dependency-path: setup.py
2422
- name: Install dependencies
2523
run: |
26-
pip install -e '.[test]'
24+
pip install '.[test]'
2725
- name: Run tests
2826
run: |
29-
pytest -vv
27+
pytest
3028
- name: Check if cog needs to be run
3129
run: |
3230
cog --check README.md

0 commit comments

Comments
 (0)