Skip to content

Commit

Permalink
update base template
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandratrapani committed Dec 18, 2024
1 parent 6f5ceae commit 064c034
Show file tree
Hide file tree
Showing 43 changed files with 1,211 additions and 2,031 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/add-to-dashboard.yml

This file was deleted.

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

jobs:
check-external-links:
name: Check for broken Sphinx external links
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # tags are required to determine the version

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Sphinx dependencies and package
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
python -m pip install .
- name: Check Sphinx external links
run: |
cd docs # run_doc_autogen assumes spec is found in ../spec/
sphinx-build -b linkcheck ./source ./test_build
4 changes: 2 additions & 2 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Codespell
on:
pull_request:
push:
workflow_dispatch:

jobs:
Expand All @@ -9,6 +9,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
14 changes: 14 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Ruff
on:
push:
workflow_dispatch:

jobs:
ruff:
name: Check for style errors and common problems
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Ruff
uses: chartboost/ruff-action@v1
49 changes: 23 additions & 26 deletions .github/workflows/run_all_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Run all tests
on:
pull_request:
push:
schedule:
- cron: '0 5 * * 0' # once every Sunday at midnight ET
workflow_dispatch:
Expand All @@ -12,6 +12,9 @@ jobs:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.name }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
Expand All @@ -38,19 +41,13 @@ jobs:
- { name: macos-python3.12 , requirements: pinned , python-ver: "3.12", os: macos-latest }
- { name: macos-python3.12-upgraded , requirements: upgraded , python-ver: "3.12", os: macos-latest }
steps:
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
- name: Checkout repo
uses: actions/checkout@v4
with:
all_but_latest: true
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # fetch tags
fetch-depth: 0 # tags are required to determine the version

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

Expand All @@ -64,19 +61,20 @@ jobs:
if: ${{ matrix.requirements == 'minimum' }}
run: |
python -m pip install -r requirements-min.txt -r requirements-dev.txt
python -m pip install -e .
python -m pip install .
- name: Install run requirements (pinned)
if: ${{ matrix.requirements == 'pinned' }}
run: |
python -m pip install -r requirements-dev.txt
python -m pip install -e .
python -m pip install .
- name: Install run requirements (upgraded)
if: ${{ matrix.requirements == 'upgraded' }}
run: |
python -m pip install -r requirements-dev.txt
python -m pip install -U -e .
# force upgrade of all dependencies to latest versions within allowed range
python -m pip install -U --upgrade-strategy eager .
- name: Run tests
run: |
Expand Down Expand Up @@ -110,6 +108,9 @@ jobs:
defaults:
run:
shell: bash -l {0} # needed for conda environment to work
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.name }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
Expand All @@ -122,18 +123,13 @@ jobs:
- { name: conda-linux-python3.12 , requirements: pinned , python-ver: "3.12", os: ubuntu-latest }
- { name: conda-linux-python3.12-upgraded , requirements: upgraded , python-ver: "3.12", os: ubuntu-latest }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0 # fetch tags
fetch-depth: 0 # tags are required to determine the version

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: true
Expand All @@ -151,19 +147,20 @@ jobs:
if: ${{ matrix.requirements == 'minimum' }}
run: |
python -m pip install -r requirements-min.txt -r requirements-dev.txt
python -m pip install -e .
python -m pip install .
- name: Install run requirements (pinned)
if: ${{ matrix.requirements == 'pinned' }}
run: |
python -m pip install -r requirements-dev.txt
python -m pip install -e .
python -m pip install .
- name: Install run requirements (upgraded)
if: ${{ matrix.requirements == 'upgraded' }}
run: |
python -m pip install -r requirements-dev.txt
python -m pip install -U -e .
# force upgrade of all dependencies to latest versions within allowed range
python -m pip install -U --upgrade-strategy eager .
- name: Run tests
run: |
Expand Down
34 changes: 16 additions & 18 deletions .github/workflows/run_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Run code coverage
on:
pull_request:
push:
workflow_dispatch:

jobs:
Expand All @@ -13,26 +13,23 @@ jobs:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}
cancel-in-progress: true
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
env: # used by codecov-action
OS: ${{ matrix.os }}
PYTHON: '3.11'
PYTHON: '3.12'
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.11.0
- name: Checkout repo
uses: actions/checkout@v4
with:
all_but_latest: true
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # fetch tags
fetch-depth: 0 # tags are required to determine the version

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON }}

Expand All @@ -43,17 +40,18 @@ jobs:
- name: Install package
run: |
python -m pip install -e . # must install in editable mode for coverage to find sources
python -m pip install .
python -m pip list
- name: Run tests and generate coverage report
run: |
pytest --cov
python -m coverage xml # codecov uploader requires xml format
python -m coverage report -m
pytest --cov --cov-report=xml --cov-report=term # codecov uploader requires xml format
# TODO uncomment after setting up repo on codecov.io
# TODO uncomment after setting up repo on codecov.io and adding token
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# uses: codecov/codecov-action@v4
# with:
# fail_ci_if_error: true
# file: ./coverage.xml
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/validate_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Validate schema

on: [push, pull_request, workflow_dispatch]

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install HDMF
run: |
pip install hdmf
- name: Download latest nwb schema language specification
run: |
curl -L https://raw.githubusercontent.com/NeurodataWithoutBorders/nwb-schema/dev/nwb.schema.json -o nwb.schema.json
- name: Validate schema specification
run: |
validate_hdmf_spec spec -m nwb.schema.json
Loading

0 comments on commit 064c034

Please sign in to comment.