Skip to content

Commit 294192a

Browse files
committed
Use the latest Python version and improve the workflows
1 parent 0070857 commit 294192a

8 files changed

Lines changed: 89 additions & 39 deletions

File tree

.github/workflows/cffconvert.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ name: cffconvert
33
on: push
44

55
jobs:
6-
verify:
7-
name: "cffconvert"
6+
7+
cffconvert:
8+
name: Verify citation metadata consistency
89
runs-on: ubuntu-latest
910
steps:
1011
- uses: actions/checkout@v2

.github/workflows/markdown-link-checker.yml renamed to .github/workflows/markdown-link-check.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
name: markdown-link-checker
1+
name: markdown-link-check
22

33
on: [push, pull_request]
44

55
jobs:
6+
67
markdown-link-check:
8+
name: Check markdown links
79
runs-on: ubuntu-latest
810
steps:
911
- uses: actions/checkout@main

.github/workflows/tests.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
name: tests
22

3-
on: push
3+
on: [push, pull_request]
44

55
jobs:
6-
tests:
7-
8-
runs-on: ubuntu-latest
96

7+
tests:
8+
name: Run template tests
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
14+
python-version: ['3.6', '3.7', '3.8', '3.9']
1015
steps:
1116
- uses: actions/checkout@v2
12-
- name: Set up Python
17+
- name: Set up Python ${{ matrix.python-version }}
1318
uses: actions/setup-python@v2
1419
with:
15-
python-version: '3.x'
20+
python-version: ${{ matrix.python-version }}
21+
- name: Python info
22+
shell: bash -l {0}
23+
run: |
24+
which python3
25+
python3 --version
1626
- name: Install dependencies
1727
run: |
1828
python3 -m pip install --upgrade pip setuptools
1929
python3 -m pip install .[dev]
20-
- name: Run tests
30+
- name: Run pytest
2131
run: |
2232
pytest
Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: build
22

33
on: [push, pull_request]
44

@@ -15,28 +15,19 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v1
18+
uses: actions/setup-python@v2
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Python info
2222
shell: bash -l {0}
2323
run: |
24-
which python
25-
python --version
26-
- name: Install package and its dependencies
24+
which python3
25+
python3 --version
26+
- name: Upgrade pip and install dependencies
2727
run: |
28-
python -m pip install --upgrade pip
29-
pip install .[dev]
30-
- name: Check style against standards using prospector
31-
shell: bash -l {0}
32-
run: prospector -o grouped -o pylint:pylint-report.txt
33-
- name: Build
28+
python3 -m pip install --upgrade pip setuptools
29+
python3 -m pip install .[publishing]
30+
- name: Verify that we can build the package
3431
shell: bash -l {0}
3532
run: |
36-
pip install -e .[dev]
37-
- name: Check style against standards using prospector
38-
shell: bash -l {0}
39-
run: prospector -0 -o grouped -o pylint:pylint-report.txt
40-
- name: Test
41-
shell: bash -l {0}
42-
run: pytest
33+
python3 setup.py sdist bdist_wheel

{{cookiecutter.project_name}}/.github/workflows/cffconvert.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: cffconvert
22

3-
on: push
3+
on: [push, pull_request]
44

55
jobs:
6+
67
verify:
78
name: "cffconvert"
89
runs-on: ubuntu-latest
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: lint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
lint:
8+
name: Lint for (${{ matrix.python-version }}, ${{ matrix.os }})
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
14+
python-version: ['3.6', '3.7', '3.8', '3.9']
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Python info
22+
shell: bash -l {0}
23+
run: |
24+
which python3
25+
python3 --version
26+
- name: Install package and its dependencies
27+
run: |
28+
python3 -m pip install --upgrade pip setuptools
29+
python3 -m pip install .[dev]
30+
- name: Check style against standards using prospector
31+
shell: bash -l {0}
32+
run: prospector --zero-exit --output-format grouped ---output-format pylint:pylint-report.txt

{{cookiecutter.project_name}}/.github/workflows/pypi.yml renamed to {{cookiecutter.project_name}}/.github/workflows/publish.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
1-
name: Publish
1+
name: publish
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
8+
89
publish:
10+
name: Publish
911
runs-on: ubuntu-latest
1012
steps:
1113
- uses: actions/checkout@v2
1214
- name: Set up Python
1315
uses: actions/setup-python@v2
1416
with:
15-
python-version: 3.7
17+
python-version: 3.9
18+
- name: Python info
19+
shell: bash -l {0}
20+
run: |
21+
which python3
22+
python3 --version
1623
- name: Install dependencies
1724
run: |
18-
python -m pip install --upgrade pip
19-
pip install setuptools wheel twine
25+
python3 -m pip install --upgrade pip setuptools
26+
python3 -m pip install .[publishing]
2027
- name: Build distributions
21-
run: python setup.py sdist bdist_wheel
28+
run: python3 setup.py sdist bdist_wheel
2229
- name: Publish package
2330
uses: pypa/gh-action-pypi-publish@release/v1
2431
with:

{{cookiecutter.project_name}}/.github/workflows/quality.yml renamed to {{cookiecutter.project_name}}/.github/workflows/sonarcloud.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
name: quality
1+
name: sonarcloud
2+
23
on:
34
push:
45
pull_request:
56
types: [opened, synchronize, reopened]
7+
68
jobs:
9+
710
sonarcloud:
811
name: SonarCloud
912
runs-on: ubuntu-latest
@@ -14,11 +17,14 @@ jobs:
1417
- name: Set up Python
1518
uses: actions/setup-python@v2
1619
with:
17-
python-version: 3.8
20+
python-version: 3.9
21+
- name: Python info
22+
shell: bash -l {0}
23+
run: |
24+
which python3
25+
python3 --version
1826
- name: Install dependencies
19-
run: python -m pip install .[dev]
20-
- name: Check style against standards using prospector
21-
run: prospector --zero-exit -o grouped -o pylint:pylint-report.txt
27+
run: python3 -m pip install .[dev]
2228
- name: Run unit tests with coverage
2329
run: pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml tests/
2430
- name: Correct coverage paths

0 commit comments

Comments
 (0)