diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml new file mode 100644 index 00000000..941ac6b9 --- /dev/null +++ b/.github/workflows/docbuild.yml @@ -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. \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..8b72e9e0 --- /dev/null +++ b/.github/workflows/docker.yml @@ -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 }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..83c62928 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 8aaecd6c..800c5989 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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