Skip to content

Commit

Permalink
Update GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Jul 30, 2024
1 parent f646acd commit ead514b
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 86 deletions.
93 changes: 55 additions & 38 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,60 @@
name: build the documentation
on: [push, pull_request]
name: Build documentation

on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
FORCE_COLOR: "1"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: set up python
uses: actions/setup-python@v5
with:
cache: 'pip'

- name: install dependencies
run: |
pip install ".[docs]"
sudo apt-get -y update
sudo apt-get -y install graphviz libclang1-11 libclang-cpp11
- name: install doxygen from SF binary archives
env:
DOXYGEN_VERSION: 1.9.4
run: |
mkdir doxygen-bin-arc && cd doxygen-bin-arc
curl -L https://sourceforge.net/projects/doxygen/files/rel-$DOXYGEN_VERSION/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz > doxygen.tar.gz
gunzip doxygen.tar.gz
tar xf doxygen.tar
cd doxygen-$DOXYGEN_VERSION
sudo make install
- name: build the documentation
run: |
make html
rm documentation/build/html/.buildinfo
- uses: actions/upload-artifact@v3
with:
name: docs build artifacts
path: |
documentation/build/html
examples/*/*/xml
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"

- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install graphviz libclang1-11 libclang-cpp11
- name: Install doxygen from SourceForge binary archives
env:
DOXYGEN_VERSION: 1.9.4
run: |
mkdir doxygen-bin-arc && cd doxygen-bin-arc
curl -L https://sourceforge.net/projects/doxygen/files/rel-$DOXYGEN_VERSION/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz > doxygen.tar.gz
gunzip doxygen.tar.gz
tar xf doxygen.tar
cd doxygen-$DOXYGEN_VERSION
sudo make install
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[docs]
- name: Build the documentation
run: |
make html
rm documentation/build/html/.buildinfo
- uses: actions/upload-artifact@v4
with:
name: docs build artifacts
path: |
documentation/build/html
examples/*/*/xml
92 changes: 74 additions & 18 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,83 @@
name: lint
on: [push, pull_request]
jobs:
build:
name: Lint source code

on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
FORCE_COLOR: "1"

jobs:
black:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "black==22.3.0"
- name: Format with black
run: black --check .

- name: set up python
uses: actions/setup-python@v5
with:
cache: 'pip'
flake8:
runs-on: ubuntu-latest

- name: install dependencies
run: |
pip install ".[lint]"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade "flake8>=6"
- name: Lint with flake8
run: flake8 breathe

mypy:
runs-on: ubuntu-latest

- name: lint the source code
run: make flake8
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[lint]"
- name: Type check with mypy
run: mypy --warn-redundant-casts --warn-unused-ignores breathe tests

- name: check source code formatting
run: make black
twine:
runs-on: ubuntu-latest

- name: type check the source code
run: make type-check
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade twine build
- name: Lint with twine
run: |
python -m build .
twine check dist/*
101 changes: 71 additions & 30 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
name: unit tests
on: [push, pull_request]
jobs:
build:
name: Tests

on:
push:
paths:
- ".github/workflows/unit_tests.yml"
- "breathe/**"
- "tests/**"
pull_request:
paths:
- ".github/workflows/unit_tests.yml"
- "breathe/**"
- "tests/**"

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
FORCE_COLOR: "1"
PYTHONDEVMODE: "1" # -X dev
PYTHONWARNDEFAULTENCODING: "1" # -X warn_default_encoding

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -14,32 +37,50 @@ jobs:
- '3.11'
- '3.12'
sphinx-version:
- '5.0.2'
- '5.1.1'
- '5.2.3'
- '5.3.0'
- '6.1.3'
- git+https://github.com/sphinx-doc/sphinx.git@master
- '5.0'
- '5.1'
- '5.2'
- '5.3'
- '6.0'
- '6.1'
- '6.2'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'

steps:
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: install dependencies
run: |
pip install ".[test]"
- name: install sphinx from PyPI or from git
run: |
if echo "${{ matrix.sphinx-version }}"|grep -q git; then
pip install ${{ matrix.sphinx-version }}
else
pip install -Iv Sphinx==${{ matrix.sphinx-version }}
fi
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Install Sphinx ${{ matrix.sphinx-version }}
run: python -m pip install --upgrade "Sphinx~=${{ matrix.sphinx-version }}.0"
- name: Test with pytest
run: python -m pytest -vv
env:
PYTHONWARNINGS: "error" # treat all warnings as errors

- name: run the unit tests
run: make dev-test
test-latest-sphinx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Install Sphinx master
run: python -m pip install "Sphinx @ git+https://github.com/sphinx-doc/sphinx"
- name: Test with pytest
run: python -m pytest -vv

0 comments on commit ead514b

Please sign in to comment.