Skip to content

Commit b43e7b8

Browse files
committed
switch to gh-actions
1 parent e922b6b commit b43e7b8

File tree

4 files changed

+192
-28
lines changed

4 files changed

+192
-28
lines changed

.github/workflows/ci-tests.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CI Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: build-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
TOX_SKIP_MISSING_INTERPRETERS: False
16+
# Rich (pip)
17+
FORCE_COLOR: 1
18+
# Tox
19+
PY_COLORS: 1
20+
# Mypy (see https://github.com/python/mypy/issues/7771)
21+
TERM: xterm-color
22+
MYPY_FORCE_COLOR: 1
23+
MYPY_FORCE_TERMINAL_WIDTH: 200
24+
# Pytest
25+
PYTEST_ADDOPTS: --color=yes
26+
27+
jobs:
28+
29+
tox:
30+
name: Tox
31+
runs-on: ubuntu-22.04
32+
strategy:
33+
matrix:
34+
py-ver-major: [3]
35+
py-ver-minor: [8, 9, 10, 11, 12]
36+
step: [lint, unit, bandit, mypy]
37+
38+
env:
39+
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
40+
TOXENV: ${{ format('py{0}{1}-{2}', matrix.py-ver-major, matrix.py-ver-minor, matrix.step) }}
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 0
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: ${{ env.py-semver }}
51+
allow-prereleases: true
52+
cache: pip
53+
54+
- name: Upgrade setuptools and install tox
55+
run: |
56+
pip install -U pip setuptools wheel
57+
pip install "tox<4" "tox-gh-actions<3"
58+
59+
- name: MyPy cache
60+
if: ${{ matrix.step == 'mypy' }}
61+
uses: actions/cache@v4
62+
with:
63+
path: .mypy_cache/${{ env.py-semver }}
64+
key: mypy-${{ env.py-semver }}
65+
66+
- name: Test with tox
67+
run: tox
68+
69+
- name: Upload coverage to Codecov
70+
if: ${{ matrix.step == 'unit' }}
71+
uses: codecov/codecov-action@v4
72+
with:
73+
fail_ci_if_error: true
74+
env:
75+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
76+
77+
tox-style:
78+
name: CI linters via Tox
79+
80+
runs-on: ubuntu-22.04
81+
82+
strategy:
83+
matrix:
84+
step: [lint-readme, pydocstyle]
85+
86+
env:
87+
py-semver: "3.12"
88+
TOXENV: ${{ format('py312-{0}', matrix.step) }}
89+
90+
steps:
91+
- uses: actions/checkout@v4
92+
with:
93+
fetch-depth: 0
94+
95+
- name: Set up Python
96+
uses: actions/setup-python@v5
97+
with:
98+
python-version: ${{ env.py-semver }}
99+
cache: pip
100+
101+
- name: Upgrade setuptools and install tox
102+
run: |
103+
pip install -U pip setuptools wheel
104+
pip install "tox<4" "tox-gh-actions<3"
105+
106+
- if: ${{ matrix.step == 'pydocstyle' && github.event_name == 'pull_request'}}
107+
name: Create local branch for diff-quality for PRs
108+
run: git branch ${{github.base_ref}} origin/${{github.base_ref}}
109+
110+
- name: Test with tox
111+
run: tox

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
MODULE1=wes_client
2424
MODULE2=wes_service
2525
PACKAGE=wes-service
26-
EXTRAS=
26+
EXTRAS=[toil,arvados]
2727

2828
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2929
# `[[` conditional expressions.
@@ -147,7 +147,7 @@ diff-cover.html: coverage.xml
147147
diff-cover --compare-branch=main $^ --html-report $@
148148

149149
## test : run the wes-service test suite
150-
test: $(PYSOURCES)
150+
test: $(PYSOURCES) FORCE
151151
python -m pytest -rsx ${PYTEST_EXTRA}
152152

153153
## testcov : run the wes-service test suite and collect coverage

tox.ini

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
[tox]
2+
envlist =
3+
py3{8,9,10,11,12}-lint,
4+
py3{8,9,10,11,12}-unit,
5+
py3{8,9,10,11,12}-bandit,
6+
py3{8,9,10,11,12}-mypy,
7+
py312-lintreadme,
8+
py312-pydocstyle
9+
isolated_build = True
10+
skip_missing_interpreters = True
11+
12+
[gh-actions]
13+
python =
14+
3.8: py38
15+
3.9: py39
16+
3.10: py310
17+
3.11: py311
18+
3.12: py312
19+
20+
[testenv]
21+
description =
22+
py3{8,9,10,11,12}-unit: Run the unit tests
23+
py3{8,9,10,11,12}-lint: Lint the Python code
24+
py3{8,9,10,11,12}-bandit: Search for common security issues
25+
py3{8,9,10,11,12}-mypy: Check for type safety
26+
py312-pydocstyle: docstring style checker
27+
py312-lintreadme: Lint the README.rst->.md conversion
28+
29+
passenv =
30+
CI
31+
GITHUB_*
32+
deps =
33+
py3{8,9,10,11,12}-{unit,mypy}: -rrequirements.txt
34+
py3{8,9,10,11,12}-{unit,mypy}: -rtest-requirements.txt
35+
py3{8,9,10,11,12}-lint: -rlint-requirements.txt
36+
py3{8,9,10,11,12}-bandit: bandit
37+
py3{8,9,10,11,12}-mypy: -rmypy-requirements.txt
38+
39+
setenv =
40+
py3{8,9,10,11,12}-unit: LC_ALL = C.UTF-8
41+
42+
commands =
43+
py3{8,9,10,11,12}-unit: python -m pip install -U pip setuptools wheel
44+
py3{8,9,10,11,12}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
45+
py3{8,9,10,11,12}-bandit: bandit --recursive wes_client wes_service
46+
py3{8,9,10,11,12}-lint: make flake8
47+
py3{8,9,10,11,12}-lint: make format-check
48+
py3{8,9,10,11,12}-mypy: make mypy mypyc
49+
50+
allowlist_externals =
51+
py3{8,9,10,11,12}-lint: flake8
52+
py3{8,9,10,11,12}-lint: black
53+
py3{8,9,10,11,12}-{mypy,memleak,shellcheck,lint,lintreadme,unit}: make
54+
55+
skip_install =
56+
py3{8,9,10,11,12}-lint: true
57+
py3{8,9,10,11,12}-bandit: true
58+
59+
extras =
60+
py3{8,9,10,11,12}-unit: toil
61+
62+
[testenv:py312-pydocstyle]
63+
allowlist_externals = make
64+
commands = make diff_pydocstyle_report
65+
deps =
66+
pydocstyle
67+
diff-cover
68+
skip_install = true
69+
70+
[testenv:py312-lintreadme]
71+
description = Lint the README.md syntax
72+
commands =
73+
make clean dist
74+
twine check dist/schema[-_]salad*
75+
deps =
76+
twine
77+
build
78+
readme_renderer[me]
79+
skip_install = true

0 commit comments

Comments
 (0)