Skip to content

Commit 8ea7432

Browse files
authored
Merge branch 'master' into test-no-deps
2 parents adcf7bc + 28c1f6e commit 8ea7432

File tree

2 files changed

+38
-24
lines changed

2 files changed

+38
-24
lines changed

.github/workflows/main.yml

+19-11
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,10 +31,12 @@ jobs:
2731
- name: Black
2832
run: tox -e black
2933

34+
- name: Bandit
35+
run: tox -e bandit
3036

3137
tests-ubuntu:
3238
name: "Test: py${{ matrix.python-version }}, Ubuntu"
33-
runs-on: ubuntu-latest
39+
runs-on: ubuntu-18.04
3440
strategy:
3541
matrix:
3642
python-version: [3.6, 3.7, 3.8]
@@ -55,7 +61,7 @@ jobs:
5561

5662
tests-no-extra-deps:
5763
name: "Test: py${{ matrix.python-version }}, Ubuntu, no extra deps"
58-
runs-on: ubuntu-latest
64+
runs-on: ubuntu-18.04
5965
strategy:
6066
matrix:
6167
python-version: [3.6, 3.7, 3.8]
@@ -64,7 +70,7 @@ jobs:
6470
- uses: actions/checkout@v2
6571

6672
- name: Set up Python ${{ matrix.python-version }}
67-
uses: actions/setup-python@v1
73+
uses: actions/setup-python@v2
6874
with:
6975
python-version: ${{ matrix.python-version }}
7076

@@ -78,6 +84,9 @@ jobs:
7884
run: bash <(curl -s https://codecov.io/bash) -cF tests
7985

8086

87+
- name: Upload coverage report
88+
run: bash <(curl -s https://codecov.io/bash)
89+
8190
tests-other-os:
8291
name: "Test: py3.8, ${{ matrix.os }}"
8392
runs-on: "${{ matrix.os }}"
@@ -89,7 +98,7 @@ jobs:
8998
- uses: actions/checkout@v2
9099

91100
- name: Set up Python 3.8
92-
uses: actions/setup-python@v1
101+
uses: actions/setup-python@v2
93102
with:
94103
python-version: 3.8
95104

@@ -99,18 +108,17 @@ jobs:
99108
- name: Run tests
100109
run: tox -e py
101110

102-
103111
publish:
104112
name: "Publish package to PyPI"
105-
runs-on: ubuntu-latest
113+
runs-on: ubuntu-18.04
106114
needs: [checks, tests-ubuntu, tests-other-os]
107115
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
108116

109117
steps:
110118
- uses: actions/checkout@v2
111119

112120
- name: Set up Python 3.8
113-
uses: actions/setup-python@v1
121+
uses: actions/setup-python@v2
114122
with:
115123
python-version: 3.8
116124

tox.ini

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = flake8,typing,black,py,no-extra-deps
2+
envlist = black,bandit,flake8,typing,py,no-extra-deps
33

44
[base]
55
deps =
@@ -15,26 +15,32 @@ deps =
1515
commands =
1616
pytest --verbose --cov=itemadapter --cov-report=term-missing --cov-report=html --cov-report=xml --cov-append --doctest-glob=README.md {posargs:itemadapter README.md tests}
1717

18-
[testenv:no-extra-deps]
18+
[testenv:bandit]
1919
deps =
20-
{[testenv]deps}
21-
setenv =
22-
ITEMADAPTER_NO_EXTRA_DEPS=True
20+
bandit
21+
commands =
22+
bandit -r {posargs:itemadapter}
23+
24+
[testenv:black]
25+
deps =
26+
black>=19.10b0
27+
commands =
28+
black --check {posargs:itemadapter tests}
2329

2430
[testenv:flake8]
2531
deps =
2632
flake8>=3.7.9
2733
commands =
28-
flake8 --exclude=.git,.tox,venv* itemadapter tests
34+
flake8 --exclude=.git,.tox,venv* {posargs:itemadapter tests}
2935

30-
[testenv:typing]
36+
[testenv:no-extra-deps]
3137
deps =
32-
mypy==0.770
33-
commands =
34-
mypy --ignore-missing-imports --follow-imports=skip itemadapter
38+
{[testenv]deps}
39+
setenv =
40+
ITEMADAPTER_NO_EXTRA_DEPS=True
3541

36-
[testenv:black]
42+
[testenv:typing]
3743
deps =
38-
black>=19.10b0
44+
mypy==0.770
3945
commands =
40-
black --check itemadapter tests
46+
mypy --ignore-missing-imports --follow-imports=skip {posargs:itemadapter}

0 commit comments

Comments
 (0)