Skip to content

Commit 8c44ea3

Browse files
committed
CI: Add specs and style checks
1 parent 615887c commit 8c44ea3

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

.github/workflows/contrib.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Contribution checks
2+
3+
# This checks validate contributions meet baseline checks
4+
#
5+
# * specs - Ensure make
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
- maint/*
12+
pull_request:
13+
branches:
14+
- master
15+
- maint/*
16+
17+
defaults:
18+
run:
19+
shell: bash
20+
21+
jobs:
22+
stable:
23+
# Check each OS, all supported Python, minimum versions and latest releases
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
matrix:
27+
os: ['ubuntu-18.04']
28+
python-version: [3.8]
29+
nipype-extras: ['dev']
30+
check: ['specs', 'style']
31+
env:
32+
DEPENDS: ""
33+
CHECK_TYPE: ${{ matrix.check }}
34+
NIPYPE_EXTRAS: ${{ matrix.nipype-extras }}
35+
EXTRA_PIP_FLAGS: ""
36+
INSTALL_DEB_DEPENDENCIES: false
37+
INSTALL_TYPE: pip
38+
CI_SKIP_TEST: 1
39+
40+
steps:
41+
- uses: actions/checkout@v2
42+
with:
43+
submodules: recursive
44+
fetch-depth: 0
45+
- name: Set up Python ${{ matrix.python-version }}
46+
uses: actions/setup-python@v2
47+
with:
48+
python-version: ${{ matrix.python-version }}
49+
- name: Display Python version
50+
run: python -c "import sys; print(sys.version)"
51+
- name: Create virtual environment
52+
run: tools/ci/create_venv.sh
53+
- name: Build archive
54+
run: |
55+
source tools/ci/build_archive.sh
56+
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
57+
- name: Install Debian dependencies
58+
run: tools/ci/install_deb_dependencies.sh
59+
if: ${{ matrix.os == 'ubuntu-18.04' }}
60+
- name: Install dependencies
61+
run: tools/ci/install_dependencies.sh
62+
- name: Install Nipype
63+
run: tools/ci/install.sh
64+
- name: Run tests
65+
run: tools/ci/check.sh
66+
if: ${{ matrix.check != 'skiptests' }}
67+
- uses: codecov/codecov-action@v1
68+
with:
69+
file: coverage.xml
70+
if: ${{ always() }}
71+
- name: Upload pytest test results
72+
uses: actions/upload-artifact@v2
73+
with:
74+
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
75+
path: test-results.xml
76+
if: ${{ always() && matrix.check == 'test' }}

tools/ci/check.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ if [ "${CHECK_TYPE}" == "test" ]; then
1616
pytest --capture=no --verbose --doctest-modules -c nipype/pytest.ini \
1717
--cov-config .coveragerc --cov nipype --cov-report xml \
1818
--junitxml=test-results.xml nipype
19+
elif [ "$CHECK_TYPE" = "specs" ]; then
20+
make specs
21+
git status -s
22+
test -z "$(git status -s)"
23+
elif [ "$CHECK_TYPE" = "style" ]; then
24+
black --check nipype setup.py
1925
else
2026
false
2127
fi

0 commit comments

Comments
 (0)