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

Create workflows #32

Merged
merged 33 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3ee6b2b
Create black.yml
mavaylon1 Aug 16, 2022
be22d1d
Create deploy_release.yml
mavaylon1 Aug 16, 2022
1806b5a
Create .pre-commit-config.yaml
mavaylon1 Aug 16, 2022
e5137fc
Create pyproject.toml
mavaylon1 Aug 16, 2022
c4dd13a
Create tox.ini
mavaylon1 Aug 16, 2022
14b7eb4
Create check_external_links.yml
mavaylon1 Aug 16, 2022
2dc29ed
Create run_all_tests.yml
mavaylon1 Aug 16, 2022
d0c3b2c
Create run_coverage.yml
mavaylon1 Aug 16, 2022
74ac94e
Create test.py
mavaylon1 Aug 16, 2022
5848279
Update overview.rst
mavaylon1 Aug 16, 2022
1b53711
Update deploy_release.yml
mavaylon1 Aug 18, 2022
62a2c5f
Create run_tests.yml
mavaylon1 Aug 18, 2022
d08bb25
Update tox.ini
mavaylon1 Aug 18, 2022
9befb15
Merge branch 'dev' into workflows
mavaylon1 Aug 18, 2022
ec2126e
Update tox.ini
mavaylon1 Aug 18, 2022
3563775
Update overview.rst
mavaylon1 Aug 18, 2022
431b087
Update test.py
mavaylon1 Aug 18, 2022
3b46814
Update test.py
mavaylon1 Aug 18, 2022
329cacb
Update run_all_tests.yml
mavaylon1 Aug 19, 2022
11a5f34
Update run_tests.yml
mavaylon1 Aug 19, 2022
5b7c7b4
Create requirements-min.txt
mavaylon1 Aug 19, 2022
6a41130
Update tox.ini
mavaylon1 Aug 19, 2022
64d9afa
Update tox.ini
mavaylon1 Aug 19, 2022
da5ebac
Update tox.ini
mavaylon1 Aug 19, 2022
70b939f
Update requirements-doc.txt
mavaylon1 Aug 19, 2022
072adf0
Update tox.ini
mavaylon1 Aug 19, 2022
2781818
Update requirements-doc.txt
mavaylon1 Aug 19, 2022
aac5a63
Update requirements-min.txt
mavaylon1 Aug 19, 2022
ac228df
Update requirements-min.txt
mavaylon1 Aug 19, 2022
df51116
Update requirements-doc.txt
mavaylon1 Aug 19, 2022
918477b
Update requirements-doc.txt
mavaylon1 Aug 19, 2022
0ef078a
Update requirements-min.txt
mavaylon1 Aug 19, 2022
07f8710
Update requirements-min.txt
mavaylon1 Aug 19, 2022
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
13 changes: 13 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: black

on: pull_request

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These actions have newer versions. Can you update these?

- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
with:
extra_args: black
33 changes: 33 additions & 0 deletions .github/workflows/check_external_links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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/cancel-workflow-action@0.9.1
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.10'

- 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: |
# use click<8 until https://github.com/j0057/github-release/issues/62 is resolved
python -m pip install "click<8" githubrelease
githubrelease --github-token ${{ secrets.BOT_GITHUB_TOKEN }} release hdmf-dev/hdmf \
create ${{ github.ref_name }} --name ${{ github.ref_name }} \
--publish
# upload assets in a separate command until https://github.com/j0057/github-release/issues/67 is resolved
githubrelease --github-token ${{ secrets.BOT_GITHUB_TOKEN }} asset hdmf-dev/hdmf \
upload ${{ github.ref_name }} \
--publish dist/*
168 changes: 168 additions & 0 deletions .github/workflows/run_all_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
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.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.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.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/cancel-workflow-action@0.9.1
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: 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 }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
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: ""

- name: Install build dependencies
run: |
conda update -n base -c defaults conda
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda install python=${{ matrix.python-ver }}
conda install 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
65 changes: 65 additions & 0 deletions .github/workflows/run_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Run code coverage
on:
push:
branches:
- dev
tags-ignore: # exclude tags created by "ci_addons publish_github_release"
- 'latest'
- 'latest-tmp'
pull_request:
workflow_dispatch:

jobs:
run-coverage:
name: ${{ matrix.os }}, opt reqs ${{ matrix.opt_req }}
runs-on: ${{ matrix.os }}
# TODO
# run pipeline on either a push event or a PR event on a fork
# if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
defaults:
run:
shell: bash
strategy:
matrix:
include:
- { os: ubuntu-latest , opt_req: true }
- { os: ubuntu-latest , opt_req: false }
- { os: windows-latest, opt_req: false }
- { os: macos-latest , opt_req: false }
env:
OS: ${{ matrix.os }}
PYTHON: '3.10'
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
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.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt -r requirements.txt

- name: Install package
run: |
python -m pip install -e . # must install in editable mode for coverage to find sources
python -m pip list
- name: Run tests and generate coverage report
run: |
python -m coverage run test.py -u
python -m coverage xml # codecov uploader requires xml format
python -m coverage report -m
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
Loading