Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Adds an initial Github Actions config for test suite. #1

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/docbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Documentation build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install software
run: |
pip install .[all]
- name: Build docs
run: |
make -C docs html
- name: Upload docs
uses: actions/upload-artifact@v1
with:
name: docs
path: docs/_build/html
- name: Create versioned docs on tag
if: startsWith(github.event.ref, 'refs/tags')
run: |
make -f ./docs/Makefile versioned CURBRANCH=${GITHUB_REF##*/}
- name: Publish docs to Github Pages
if: startsWith(github.event.ref, 'refs/tags')
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.DOCDEPLOY_ACCESS_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs/_build/html # The folder the action should deploy.
37 changes: 37 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Docker
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Build docker image
run: |
# Get version, update files.
THISVERSION=$( python get_version.py )
if [[ ${THISVERSION:0:2} == "0+" ]] ; then
echo "WARNING: latest git tag could not be found"
echo "Please, make sure you fetch all tags from upstream with"
echo "the command ``git fetch --tags --verbose`` and push"
echo "them to your fork with ``git push origin --tags``"
fi
# Build docker image
e=1 && for i in {1..5}; do
docker build --rm \
-t nipreps/dmriprep:latest \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VERSION="${CIRCLE_TAG:-$THISVERSION}" . \
&& e=0 && break || sleep 15
done && [ "$e" -eq "0" ]
- name: Push docker image
if: startsWith(github.event.ref, 'refs/tags') || startsWith(github.event.ref, 'docker/') || github.event.pull_request.merged == true
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker tag nipreps/dmriprep nipreps/dmriprep:${{ github.sha }}
docker push nipreps/dmriprep:$${{ github.sha }}
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test suite

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7]

steps:
- name: Checkout repo
uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install software
run: |
pip install .[all]
- name: Test
run: |
pytest dmriprep
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ putty-ignore =

[tool:pytest]
norecursedirs = .* _*
addopts = -vx --doctest-modules
addopts = -n 2 -vv --doctest-modules --cov dmriprep --cov-config .coveragerc --cov-report xml:cov.xml
doctest_optionflags = ALLOW_UNICODE NORMALIZE_WHITESPACE
env =
PYTHONHASHSEED=0
Expand Down