Skip to content

Commit 28c1f6e

Browse files
authored
Update CI config (#46)
* Update CI config * CI: Upload coverage report only from Ubuntu jobs * Restrict CI to the master branch and pull requests
1 parent d749c22 commit 28c1f6e

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

.github/workflows/main.yml

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
48

59
jobs:
610
checks:
7-
name: Lint, typing, coverage
8-
runs-on: ubuntu-latest
11+
name: Lint, typing, security
12+
runs-on: ubuntu-18.04
913

1014
steps:
1115
- uses: actions/checkout@v2
1216

1317
- name: Set up Python 3.8
14-
uses: actions/setup-python@v1
18+
uses: actions/setup-python@v2
1519
with:
1620
python-version: 3.8
1721

@@ -27,16 +31,12 @@ jobs:
2731
- name: Black
2832
run: tox -e black
2933

30-
- name: Generate coverage report
31-
run: tox -e py
32-
33-
- name: Upload coverage report
34-
run: bash <(curl -s https://codecov.io/bash)
35-
34+
- name: Bandit
35+
run: tox -e bandit
3636

3737
tests-ubuntu:
3838
name: "Test: py${{ matrix.python-version }}, Ubuntu"
39-
runs-on: ubuntu-latest
39+
runs-on: ubuntu-18.04
4040
strategy:
4141
matrix:
4242
python-version: [3.6, 3.7, 3.8]
@@ -45,7 +45,7 @@ jobs:
4545
- uses: actions/checkout@v2
4646

4747
- name: Set up Python ${{ matrix.python-version }}
48-
uses: actions/setup-python@v1
48+
uses: actions/setup-python@v2
4949
with:
5050
python-version: ${{ matrix.python-version }}
5151

@@ -55,6 +55,9 @@ jobs:
5555
- name: Run tests
5656
run: tox -e py
5757

58+
- name: Upload coverage report
59+
run: bash <(curl -s https://codecov.io/bash)
60+
5861
tests-other-os:
5962
name: "Test: py3.8, ${{ matrix.os }}"
6063
runs-on: "${{ matrix.os }}"
@@ -66,7 +69,7 @@ jobs:
6669
- uses: actions/checkout@v2
6770

6871
- name: Set up Python 3.8
69-
uses: actions/setup-python@v1
72+
uses: actions/setup-python@v2
7073
with:
7174
python-version: 3.8
7275

@@ -76,18 +79,17 @@ jobs:
7679
- name: Run tests
7780
run: tox -e py
7881

79-
8082
publish:
8183
name: "Publish package to PyPI"
82-
runs-on: ubuntu-latest
84+
runs-on: ubuntu-18.04
8385
needs: [checks, tests-ubuntu, tests-other-os]
8486
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
8587

8688
steps:
8789
- uses: actions/checkout@v2
8890

8991
- name: Set up Python 3.8
90-
uses: actions/setup-python@v1
92+
uses: actions/setup-python@v2
9193
with:
9294
python-version: 3.8
9395

0 commit comments

Comments
 (0)