Skip to content

Commit

Permalink
Use GitHub Actions for CI (#1560)
Browse files Browse the repository at this point in the history
  • Loading branch information
rly authored Oct 4, 2022
1 parent d901388 commit 6e1f131
Show file tree
Hide file tree
Showing 23 changed files with 963 additions and 936 deletions.
498 changes: 0 additions & 498 deletions .circleci/config.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/check_external_links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check Sphinx external links
on:
pull_request:
schedule:
- cron: '0 5 * * *' # once per day at midnight ET
workflow_dispatch:

jobs:
check-external-links:
runs-on: ubuntu-latest
steps:
- name: Cancel any previous incomplete runs
uses: styfle/[email protected]
with:
all_but_latest: true
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8' # allensdk requires 3.8

- name: Install Sphinx dependencies and package
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-doc.txt -r requirements.txt
python -m pip install .
- name: Check Sphinx external links
run: sphinx-build -b linkcheck ./docs/source ./test_build
54 changes: 54 additions & 0 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy release
on:
push:
tags: # run only on new tags that follow semver MAJOR.MINOR.PATCH
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
deploy-release:
name: Deploy release from tag
runs-on: ubuntu-latest
steps:
- name: Checkout repo with submodules
uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
python -m pip list
- name: Run tox tests
run: |
tox -e py310-upgraded
- name: Build wheel and source distribution
run: |
tox -e build-py310-upgraded
ls -1 dist
- name: Test installation from a wheel
run: |
tox -e wheelinstall --recreate --installpkg dist/*-none-any.whl
- name: Upload wheel and source distributions to PyPI
run: |
python -m pip install twine
ls -1 dist
# twine upload --repository testpypi -u ${{ secrets.BOT_PYPI_USER }} -p ${{ secrets.BOT_PYPI_PASSWORD }} --skip-existing dist/*
twine upload -u ${{ secrets.BOT_PYPI_USER }} -p ${{ secrets.BOT_PYPI_PASSWORD }} --skip-existing dist/*
- name: Publish wheel and source distributions as a GitHub release
run: |
python -m pip install "githubrelease>=1.5.9"
githubrelease --github-token ${{ secrets.BOT_GITHUB_TOKEN }} release NeurodataWithoutBorders/pynwb \
create ${{ github.ref_name }} --name ${{ github.ref_name }} \
--publish dist/*
274 changes: 274 additions & 0 deletions .github/workflows/run_all_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
name: Run all tests
on:
schedule:
- cron: '0 5 * * *' # once per day at midnight ET
push:
tags: # run only on new tags that follow semver
- '/^[0-9]+(\.[0-9]+)?(\.[0-9]+)?$/'
workflow_dispatch:

jobs:
run-all-tests:
# the only differences between this job and "run_tests.yml" is the "strategy.matrix.include" and the upload
# distributions step.
# GitHub Actions does not yet support YAML anchors, easily reusable components, or easy dynamic matrix
# configurations based on the github event, so this job is duplicated for the most part
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- { name: linux-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: ubuntu-latest }
- { name: linux-python3.7 , test-tox-env: py37 , build-tox-env: build-py37 , python-ver: "3.7" , os: ubuntu-latest }
- { name: linux-python3.8 , test-tox-env: py38 , build-tox-env: build-py38 , python-ver: "3.8" , os: ubuntu-latest }
- { name: linux-python3.9 , test-tox-env: py39 , build-tox-env: build-py39 , python-ver: "3.9" , os: ubuntu-latest }
- { name: linux-python3.10 , test-tox-env: py310 , build-tox-env: build-py310 , python-ver: "3.10", os: ubuntu-latest }
- { name: linux-python3.10-optional , test-tox-env: py310-optional , build-tox-env: build-py310-optional , python-ver: "3.10", os: ubuntu-latest }
- { name: linux-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: ubuntu-latest }
- { name: linux-python3.10-prerelease , test-tox-env: py310-prerelease, build-tox-env: build-py310-prerelease, python-ver: "3.10", os: ubuntu-latest }
- { name: windows-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: windows-latest }
- { name: windows-python3.7 , test-tox-env: py37 , build-tox-env: build-py37 , python-ver: "3.7" , os: windows-latest }
- { name: windows-python3.8 , test-tox-env: py38 , build-tox-env: build-py38 , python-ver: "3.8" , os: windows-latest }
- { name: windows-python3.9 , test-tox-env: py39 , build-tox-env: build-py39 , python-ver: "3.9" , os: windows-latest }
- { name: windows-python3.10 , test-tox-env: py310 , build-tox-env: build-py310 , python-ver: "3.10", os: windows-latest }
- { name: windows-python3.10-optional , test-tox-env: py310-optional , build-tox-env: build-py310-optional , python-ver: "3.10", os: windows-latest }
- { name: windows-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: windows-latest }
- { name: windows-python3.10-prerelease, test-tox-env: py310-prerelease, build-tox-env: build-py310-prerelease, python-ver: "3.10", os: windows-latest }
- { name: macos-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: macos-latest }
- { name: macos-python3.7 , test-tox-env: py37 , build-tox-env: build-py37 , python-ver: "3.7" , os: macos-latest }
- { name: macos-python3.8 , test-tox-env: py38 , build-tox-env: build-py38 , python-ver: "3.8" , os: macos-latest }
- { name: macos-python3.9 , test-tox-env: py39 , build-tox-env: build-py39 , python-ver: "3.9" , os: macos-latest }
- { name: macos-python3.10 , test-tox-env: py310 , build-tox-env: build-py310 , python-ver: "3.10", os: macos-latest }
- { name: macos-python3.10-optional , test-tox-env: py310-optional , build-tox-env: build-py310-optional , python-ver: "3.10", os: macos-latest }
- { name: macos-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: macos-latest }
- { name: macos-python3.10-prerelease , test-tox-env: py310-prerelease, build-tox-env: build-py310-prerelease, python-ver: "3.10", os: macos-latest }
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-ver }}

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
python -m pip list
- name: Run tox tests
run: |
tox -e ${{ matrix.test-tox-env }}
- name: Build wheel and source distribution
run: |
tox -e ${{ matrix.build-tox-env }}
ls -1 dist
- name: Test installation from a wheel
run: |
tox -e wheelinstall --recreate --installpkg dist/*-none-any.whl
run-all-gallery-tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- { name: linux-gallery-python3.7-minimum , test-tox-env: gallery-py37-minimum , python-ver: "3.7" , os: ubuntu-latest }
- { name: linux-gallery-python3.8-upgraded , test-tox-env: gallery-py38-upgraded , python-ver: "3.8" , os: ubuntu-latest }
- { name: linux-gallery-python3.8-prerelease , test-tox-env: gallery-py38-prerelease , python-ver: "3.8" , os: ubuntu-latest }
# allensdk is not compatible with python 3.9+, so run gallery tests only on python <=3.8
# - { name: linux-gallery-python3.10-upgraded , test-tox-env: gallery-py310-upgraded , python-ver: "3.10", os: ubuntu-latest }
# - { name: linux-gallery-python3.10-prerelease , test-tox-env: gallery-py310-prerelease, python-ver: "3.10", os: ubuntu-latest }
- { name: windows-gallery-python3.7-minimum , test-tox-env: gallery-py37-minimum , python-ver: "3.7" , os: windows-latest }
- { name: windows-gallery-python3.8-upgraded , test-tox-env: gallery-py38-upgraded , python-ver: "3.8" , os: windows-latest }
- { name: windows-gallery-python3.8-prerelease , test-tox-env: gallery-py38-prerelease , python-ver: "3.8" , os: windows-latest }
# - { name: windows-gallery-python3.10-upgraded , test-tox-env: gallery-py310-upgraded , python-ver: "3.10", os: windows-latest }
# - { name: windows-gallery-python3.10-prerelease, test-tox-env: gallery-py310-prerelease, python-ver: "3.10", os: windows-latest }
- { name: macos-gallery-python3.7-minimum , test-tox-env: gallery-py37-minimum , python-ver: "3.7" , os: macos-latest }
- { name: macos-gallery-python3.8-upgraded , test-tox-env: gallery-py38-upgraded , python-ver: "3.8" , os: macos-latest }
- { name: macos-gallery-python3.8-prerelease , test-tox-env: gallery-py38-prerelease , python-ver: "3.8" , os: macos-latest }
# - { name: macos-gallery-python3.10-upgraded , test-tox-env: gallery-py310-upgraded , python-ver: "3.10", os: macos-latest }
# - { name: macos-gallery-python3.10-prerelease , test-tox-env: gallery-py310-prerelease, python-ver: "3.10", os: macos-latest }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-ver }}

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
python -m pip list
- name: Run tox tests
run: |
tox -e ${{ matrix.test-tox-env }}
run-all-tests-on-conda:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0} # needed for conda environment to work
strategy:
fail-fast: false
matrix:
include:
- { name: conda-linux-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: ubuntu-latest }
- { name: conda-linux-python3.7 , test-tox-env: py37 , build-tox-env: build-py37 , python-ver: "3.7" , os: ubuntu-latest }
- { name: conda-linux-python3.8 , test-tox-env: py38 , build-tox-env: build-py38 , python-ver: "3.8" , os: ubuntu-latest }
- { name: conda-linux-python3.9 , test-tox-env: py39 , build-tox-env: build-py39 , python-ver: "3.9" , os: ubuntu-latest }
- { name: conda-linux-python3.10 , test-tox-env: py310 , build-tox-env: build-py310 , python-ver: "3.10", os: ubuntu-latest }
- { name: conda-linux-python3.10-optional , test-tox-env: py310-optional , build-tox-env: build-py310-optional , python-ver: "3.10", os: ubuntu-latest }
- { name: conda-linux-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: ubuntu-latest }
- { name: conda-linux-python3.10-prerelease, test-tox-env: py310-prerelease, build-tox-env: build-py310-prerelease, python-ver: "3.10", os: ubuntu-latest }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: true
activate-environment: true
python-version: ${{ matrix.python-ver }}

- name: Install build dependencies
run: |
conda config --set always_yes yes --set changeps1 no
conda info
conda install -c conda-forge tox
conda list
- name: Run tox tests
run: |
tox -e ${{ matrix.test-tox-env }}
- name: Build wheel and source distribution
run: |
tox -e ${{ matrix.build-tox-env }}
ls -1 dist
- name: Test installation from a wheel
run: |
tox -e wheelinstall --recreate --installpkg dist/*-none-any.whl
run-ros3-tests: # tox and conda do not play nicely so do not use tox here
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0} # necessary for conda
strategy:
fail-fast: false
matrix:
include:
- { name: linux-python3.9-ros3 , python-ver: "3.9", os: ubuntu-latest }
- { name: windows-python3.9-ros3, python-ver: "3.9", os: windows-latest }
- { name: macos-python3.9-ros3 , python-ver: "3.9", os: macos-latest }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: ros3
environment-file: environment-ros3.yml
python-version: ${{ matrix.python-ver }}
channels: conda-forge
auto-activate-base: false

- name: Install run dependencies
run: |
pip install -r requirements-dev.txt
pip install -e .
conda info
conda list
pip list
- name: Run gallery ros3 tests
run: |
python test.py --ros3
run-gallery-ros3-tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0} # necessary for conda
strategy:
fail-fast: false
matrix:
include:
- { name: linux-gallery-python3.9-ros3 , python-ver: "3.9", os: ubuntu-latest }
- { name: windows-gallery-python3.9-ros3, python-ver: "3.9", os: windows-latest }
- { name: macos-gallery-python3.9-ros3 , python-ver: "3.9", os: macos-latest }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: ros3
environment-file: environment-ros3.yml
python-version: ${{ matrix.python-ver }}
channels: conda-forge
auto-activate-base: false

- name: Install run dependencies
run: |
pip install matplotlib
pip install -e .
conda info
conda list
pip list
- name: Run gallery ros3 tests
run: |
python test.py --example-ros3
Loading

0 comments on commit 6e1f131

Please sign in to comment.