Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
56 changes: 56 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

# This workflow will build the CoRelAy project and publish the artifacts to PyPI when a GitHub release is created
name: CoRelAy Continuous Deployment

# This workflow will run when a new release is created on GitHub, the process works like this:
# 1) For each milestone multiple issues are created
# 2) For each issue a new branch is branched off from the develop branch (which itself is branched off from main)
# 3) When the issue is resolved, a pull request is created to merge the issue branch into the develop branch
# 4) Once all issues for a milestone are resolved, a pull request is created to merge the develop branch into the main branch
# 5) When the pull request is merged, a new release is created
# 6) This workflow will then be triggered and the CoRelAy project will be built and published to PyPI
on:
release:
types:
- created

# This workflow contains a single job for building and publishing the CoRelAy project
jobs:

# Builds and publishes the CoRelAy project
build-and-publish:

# The job will run on the latest version of Ubuntu
name: Build and Publish the CoRelAy Project
runs-on: ubuntu-latest

# Gives the job permission to write the ID token, which is required for trusted publishing; trusted publishing is a way to publish packages to a
# package index (like PyPI) without needing to store credentials in the repository; trusted publishing is set up beforehand and during the
# publishing step and allows the job to automatically authenticate with the package index to retrieve a JWT token for publishing the package; the
# write permission is allows GitHub to generate an OIDC token, which is used to authenticate with the package index and retrieve the JWT token
permissions:
id-token: write

# Specifies that we want to deploy to PyPI
environment:
name: pypi
url: https://pypi.org/p/corelay

# The job contains several steps: 1) checking out the repository, 2) installing the Python project management tool uv, 3) installing Python, 4)
# installing the dependencies of CoRelAy, 5) building the CoRelAy project, and 6) publishing the CoRelAy project
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.6.13
- name: Install Python
run: uv python install 3.13.2
- name: Install CoRelAy and its Dependencies
run: uv sync
- name: Build the CoRelAy Project
run: uv build
- name: Publish the CoRelAy Project to PyPI
run: uv publish
257 changes: 198 additions & 59 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,223 @@
name: tests

# This workflow will run the unit tests, the linters, the static type checker, the spell checker, and will build the documentation
name: CoRelAy Continuous Integration

# This workflow runs when commits are pushed to the main/develop branch or when a pull request for the main/develop branch is opened or pushed to
on:
push:
branches: [master]
branches:
- main
- develop
pull_request:
branches: [master]
branches:
- main
- develop

# This workflow contains multiple jobs for unit testing, linting, type checking, spell checking, and building
jobs:
test:
name: test ${{matrix.tox_env}}

# Runs the unit tests on Python 3.11, 3.12, and 3.13
unit-tests:

# The job will run on the latest version of Ubuntu using a matrix strategy, where the unit tests are run using Python 3.11, 3.12, and 3.13
name: Unit Test CoRelAy on Python ${{matrix.python-version}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- tox_env: py37
python: "3.7"
- tox_env: py38
python: "3.8"
- tox_env: py39
python: "3.9"
- tox-environment: py311
python-version: "3.11.12"
- tox-environment: py312
python-version: "3.12.10"
- tox-environment: py313
python-version: "3.13.3"

# The job contains several steps: 1) checking out the repository, 2) installing the Python project management tool uv, 3) installing the correct
# Python version, 4) setting up the test environment by installing CoRelAy and its dependencies, and finally 5) running the unit tests
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install base python for tox
uses: actions/setup-python@v2
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.6.14
- name: Install Python
run: uv python install ${{ matrix.python-version }}
- name: Install CoRelAy and its Dependencies
run: uv sync --dev
- name: Run Unit Tests
run: uv run tox run -e ${{ matrix.tox-environment }}

# Runs the PyLint linter
pylint:

# The job will run on the latest version of Ubuntu
name: Lint CoRelAy Using PyLint
runs-on: ubuntu-latest

# The job contains several steps: 1) checking out the repository, 2) installing the Python project management tool uv, 3) installing the correct
# Python version, 4) setting up the test environment by installing CoRelAy and its dependencies, and 5) running the PyLint linter
steps:
- uses: actions/checkout@v4
with:
python-version: "3.9"
- name: Install tox
run: python -m pip install tox
- name: Install python for test
uses: actions/setup-python@v2
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python }}
- name: Setup test environment
run: tox -vv --notest -e ${{ matrix.tox_env }}
- name: Run test
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}
version: 0.6.14
- name: Install Python
run: uv python install 3.13.3
- name: Install CoRelAy and its Dependencies
run: uv sync --dev
- name: Run PyLint Linter
run: uv run tox run -e pylint

# Runs the PyCodeStyle linter
pycodestyle:

check:
name: check ${{ matrix.tox_env }}
# The job will run on the latest version of Ubuntu
name: Lint CoRelAy Using PyCodeStyle
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tox_env:
- flake8
- pylint

# The job contains several steps: 1) checking out the repository, 2) installing the Python project management tool uv, 3) installing the correct
# Python version, 4) setting up the test environment by installing CoRelAy and its dependencies, and 5) running the PyCodeStyle linter
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install base python for tox
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install tox
run: python -m pip install tox
- name: Setup test environment
run: tox -vv --notest -e ${{ matrix.tox_env }}
- name: Run test
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}

docs:
name: docs
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.6.14
- name: Install Python
run: uv python install 3.13.3
- name: Install CoRelAy and its Dependencies
run: uv sync --dev
- name: Run PyCodeStyle
run: uv run tox run -e pycodestyle

# Runs the PyDocLint docstring linter
pydoclint:

# The job will run on the latest version of Ubuntu
name: Lint CoRelAy Docstrings Using PyDocLint
runs-on: ubuntu-latest
strategy:
fail-fast: false

# The job contains several steps: 1) checking out the repository, 2) installing the Python project management tool uv, 3) installing the correct
# Python version, 4) setting up the test environment by installing CoRelAy and its dependencies, and 5) running the PyDocLint docstring linter
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install base python for tox
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install tox
run: python -m pip install tox
- name: Setup test environment
run: tox -vv --notest -e docs
- name: Run test
run: tox --skip-pkg-install -e docs
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.6.14
- name: Install Python
run: uv python install 3.13.3
- name: Install CoRelAy and its Dependencies
run: uv sync --dev
- name: Run PyDocLint
run: uv run tox run -e pydoclint

# Runs the MyPy static type checker
mypy:

# The job will run on the latest version of Ubuntu
name: Static Type-Check CoRelAy Using MyPy
runs-on: ubuntu-latest

# The job contains several steps: 1) checking out the repository, 2) installing the Python project management tool uv, 3) installing the correct
# Python version, 4) setting up the test environment by installing CoRelAy and its dependencies, and 5) running the MyPy static type checker
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.6.14
- name: Install Python
run: uv python install 3.13.3
- name: Install CoRelAy and its Dependencies
run: uv sync --dev
- name: Run MyPy
run: uv run tox run -e mypy

# Runs the Markdownlint linter
markdownlint:

# The job will run on the latest version of Ubuntu
name: Lint CoRelAy Using Markdownlint
runs-on: ubuntu-latest

# The job contains several steps: 1) checking out the repository, 2) installing Node.js, 3) installing the dependencies of the Markdownlint
# global configuration, and 4) running the Markdownlint linter
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '22.14.0'
- name: Install Markdownlint Global Configuration
run: npm --prefix tests/linters/markdownlint install
- name: Run Markdown Linter
run: npm --prefix tests/linters/markdownlint run markdownlint

# Runs the spell checker CSpell to spell-check all files in the repository
spell-check:

# The job will run on the latest version of Ubuntu; usually, when a job fails, the entire workflow will fail, but in this case, we do not want the
# the workflow to fail if the spell-check fails
name: Spell-Check Repository
runs-on: ubuntu-latest
continue-on-error: true

# The job contains several steps: 1) checking out the repository, 2) installing Node.js, 3) installing the dependencies of the CSpell global
# configuration, and 4) running the CSpell spell checker
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22.14.0"
- name: Install CSpell Global Configuration
run: npm --prefix tests/linters/cspell install
- name: Run CSpell Spell Checker
run: npm --prefix tests/linters/cspell run cspell

# Builds the documentation using Sphinx
build-documentation:

# The job will run on the latest version of Ubuntu; usually, when a job fails, the entire workflow will fail, but in this case, we do not want the
# the workflow to fail if the documentation build fails
name: Build CoRelAy Documentation
runs-on: ubuntu-latest
continue-on-error: true

# The job contains several steps: 1) checking out the repository, 2) installing the Python project management tool uv, 3) installing the correct
# Python version, 4) installing TeX Live, which is required by Pybtex, a replacement for BibTeX, used by Sphinx to generate the citations in the
# documentation, and 5) building the documentation
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.6.14
- name: Install Python
run: uv python install 3.13.3
- name: Install TeX Live for Pybtex
run: sudo apt-get update -y && sudo apt-get install -y texlive texlive-latex-extra dvipng
- name: Build Documentation
run: uv run tox run --notest -e docs
Loading
Loading