Skip to content

Commit 506ac9d

Browse files
authored
Enable CI via GitHub Actions (#1411)
1 parent 3a32a8f commit 506ac9d

File tree

9 files changed

+201
-135
lines changed

9 files changed

+201
-135
lines changed

.github/workflows/ci-tests.yml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
name: Continous integration tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
singularity_version: 3.6.4
9+
10+
jobs:
11+
12+
tox:
13+
name: CI tests via Tox
14+
15+
runs-on: ubuntu-20.04
16+
17+
strategy:
18+
matrix:
19+
py-ver-major: [3]
20+
py-ver-minor: [6, 7, 8, 9]
21+
step: [lint, unit, bandit, mypy]
22+
exclude:
23+
- py-ver-major: 3
24+
py-ver-minor: 9
25+
step: mypy
26+
27+
env:
28+
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
29+
TOXENV: ${{ format('py{0}{1}-{2}', matrix.py-ver-major, matrix.py-ver-minor, matrix.step) }}
30+
31+
steps:
32+
- uses: actions/checkout@v2
33+
34+
- name: Set up Singularity
35+
if: ${{ matrix.step == 'unit' || matrix.step == 'mypy' }}
36+
uses: eWaterCycle/setup-singularity@v6
37+
with:
38+
singularity-version: ${{ env.singularity_version }}
39+
40+
- name: Give the test runner user a name to make provenance happy.
41+
if: ${{ matrix.step == 'unit' || matrix.step == 'mypy' }}
42+
run: sudo usermod -c 'CI Runner' $(whoami)
43+
44+
- name: Set up Python
45+
uses: actions/setup-python@v2
46+
with:
47+
python-version: ${{ env.py-semver }}
48+
49+
- name: Cache for pip
50+
uses: actions/cache@v2
51+
with:
52+
path: ~/.cache/pip
53+
key: ${{ runner.os }}-pip-${{ matrix.step }}-${{ hashFiles('requirements.txt', 'tox.ini') }}
54+
55+
- name: Upgrade setuptools and install tox
56+
run: |
57+
pip install -U pip setuptools wheel
58+
pip install tox tox-gh-actions
59+
60+
- name: MyPy cache
61+
if: ${{ matrix.step == 'mypy' }}
62+
uses: actions/cache@v2
63+
with:
64+
path: .mypy_cache/${{ env.py-semver }}
65+
key: mypy-${{ env.py-semver }}
66+
67+
- name: Test with tox
68+
run: tox
69+
70+
- name: Upload coverage to Codecov
71+
if: ${{ matrix.step == 'unit' }}
72+
uses: codecov/codecov-action@v1
73+
with:
74+
fail_ci_if_error: true
75+
76+
tox-style:
77+
name: CI linters via Tox
78+
79+
runs-on: ubuntu-20.04
80+
81+
strategy:
82+
matrix:
83+
step: [lint-readme, shellcheck, pydocstyle]
84+
85+
env:
86+
py-semver: 3.9
87+
TOXENV: ${{ format('py39-{0}', matrix.step) }}
88+
89+
steps:
90+
- uses: actions/checkout@v2
91+
with:
92+
fetch-depth: 0
93+
94+
- name: Set up Python
95+
uses: actions/setup-python@v2
96+
with:
97+
python-version: ${{ env.py-semver }}
98+
99+
- name: Cache for pip
100+
uses: actions/cache@v2
101+
with:
102+
path: ~/.cache/pip
103+
key: ${{ runner.os }}-pip-${{ matrix.step }}-${{ hashFiles('requirements.txt') }}
104+
105+
- name: Upgrade setuptools and install tox
106+
run: |
107+
pip install -U pip setuptools wheel
108+
pip install tox tox-gh-actions
109+
110+
- if: ${{ matrix.step == 'pydocstyle' }}
111+
name: Create local branch main == origin/main for diff-quality
112+
run: git branch main origin/main
113+
114+
- name: Test with tox
115+
run: tox
116+
117+
conformance_tests:
118+
name: CWL spec conformance tests
119+
120+
runs-on: ubuntu-20.04
121+
122+
strategy:
123+
matrix:
124+
cwl-version: [v1.0, v1.1, v1.2]
125+
126+
steps:
127+
- uses: actions/checkout@v2
128+
129+
- name: Set up Python
130+
uses: actions/setup-python@v2
131+
with:
132+
python-version: 3.9
133+
134+
- name: Cache for pip
135+
uses: actions/cache@v2
136+
with:
137+
path: ~/.cache/pip
138+
key: ${{ runner.os }}-conformance-${{ matrix.step }}-${{ hashFiles('requirements.txt') }}
139+
140+
- name: Run CWL conformance tests ${{ matrix.cwl-version }}
141+
env:
142+
version: ${{ matrix.cwl-version }}
143+
run: ./conformance-test.sh
144+
145+
release_test:
146+
name: CWL release test
147+
148+
runs-on: ubuntu-20.04
149+
150+
steps:
151+
- uses: actions/checkout@v2
152+
153+
- name: Set up Singularity
154+
uses: eWaterCycle/setup-singularity@v6
155+
with:
156+
singularity-version: ${{ env.singularity_version }}
157+
158+
- name: Set up Python
159+
uses: actions/setup-python@v2
160+
with:
161+
python-version: 3.9
162+
163+
- name: Give the test runner user a name to make provenance happy.
164+
run: sudo usermod -c 'CI Runner' $(whoami)
165+
166+
- name: Cache for pip
167+
uses: actions/cache@v2
168+
with:
169+
path: ~/.cache/pip
170+
key: ${{ runner.os }}-pip-release-${{ hashFiles('requirements.txt', 'test-requirements.txt') }}
171+
172+
- name: Install packages
173+
run: |
174+
pip install -U pip setuptools wheel
175+
pip install virtualenv
176+
177+
- name: Release test
178+
env:
179+
RELEASE_SKIP: head
180+
run: ./release-test.sh

.travis.singularity_key.txt

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

.travis.yml

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

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ mypyc: ${PYSOURCES}
172172
MYPYPATH=typeshed/2and3/:typeshed/3 CWLTOOL_USE_MYPYC=1 pip install --verbose -e . && pytest --ignore cwltool/schemas --basetemp ./tmp
173173

174174
shellcheck: FORCE
175-
shellcheck build-cwl-docker.sh cwl-docker.sh release-test.sh travis.bash \
175+
shellcheck build-cwl-docker.sh cwl-docker.sh release-test.sh conformance-test.sh \
176176
cwltool-in-docker.sh
177177

178178
release-test: FORCE

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Common Workflow Language tool description reference implementation
44

55
|Linux Status| |Debian Stable package| |Debian Testing package| |Windows Status| |Coverage Status| |Downloads|
66

7-
.. |Linux Status| image:: https://img.shields.io/travis/common-workflow-language/cwltool/main.svg?label=Linux%20builds
8-
:target: https://travis-ci.org/common-workflow-language/cwltool
7+
.. |Linux Status| image:: https://github.com/common-workflow-language/cwltool/actions/workflows/ci-tests.yml/badge.svg?branch=main
8+
:target: https://github.com/common-workflow-language/cwltool/actions/workflows/ci-tests.yml
99

1010
.. |Debian Stable package| image:: https://badges.debian.net/badges/debian/stable/cwltool/version.svg
1111
:target: https://packages.debian.org/stable/cwltool
@@ -61,7 +61,7 @@ please follow the install instructions for `conda-forge <https://conda-forge.org
6161
conda install -c conda-forge cwltool
6262
6363
All of the above methods of installing ``cwltool`` use packages which might contain bugs already fixed in newer versions, or be missing features that you desire.
64-
If the packaged version of ``cwltool`` available to you is too old, then we recommend installing using ``pip`` and ``venv`::
64+
If the packaged version of ``cwltool`` available to you is too old, then we recommend installing using ``pip`` and ``venv``::
6565

6666
.. code:: bash
6767
File renamed without changes.

release-test.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@ export LC_ALL=C
77

88
package=cwltool
99
module=cwltool
10-
slug=${TRAVIS_PULL_REQUEST_SLUG:=common-workflow-language/cwltool}
11-
repo=https://github.com/${slug}.git
10+
11+
if [ "$GITHUB_ACTIONS" = "true" ]; then
12+
# We are running as a GH Action
13+
repo=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git
14+
HEAD=${GITHUB_SHA}
15+
else
16+
repo=https://github.com/common-workflow-language/cwltool.git
17+
HEAD=$(git rev-parse HEAD)
18+
fi
19+
1220
test_prefix=""
1321
run_tests() {
1422
local mod_loc
@@ -24,7 +32,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
2432

2533
rm -Rf testenv? || /bin/true
2634

27-
export HEAD=${TRAVIS_PULL_REQUEST_SHA:-$(git rev-parse HEAD)}
2835

2936
if [ "${RELEASE_SKIP}" != "head" ]
3037
then

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ rdflib>=4.2.2,<5.1
44
shellescape>=3.4.1,<3.5
55
schema-salad>=7.0.20210124093443,<8
66
prov==1.5.1
7-
bagit==1.6.4
7+
bagit==1.7.0
88
mypy-extensions
99
psutil
1010
typing-extensions

tox.ini

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ envlist =
1111
skipsdist = True
1212
skip_missing_interpreters = True
1313

14-
[travis]
14+
[gh-actions]
1515
python =
16-
3.6: py36
17-
3.7: py37
18-
3.8: py38
19-
3.9: py39
16+
3.6: py36
17+
3.7: py37
18+
3.8: py38
19+
3.9: py39
2020

2121
[testenv]
2222
description =
@@ -29,8 +29,7 @@ description =
2929

3030
passenv =
3131
CI
32-
TRAVIS
33-
TRAVIS_*
32+
GITHUB_*
3433
PROOT_NO_SECCOMP
3534
deps =
3635
py{36,37,38,39}-{unit,lint,bandit,mypy}: -rrequirements.txt

0 commit comments

Comments
 (0)