-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from ImperialCollegeLondon/release/3.0.1
Release candidate 3.0.1 RC 7
- Loading branch information
Showing
114 changed files
with
6,035 additions
and
3,360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
name: Test and build | ||
|
||
on: [push, pull_request, release] | ||
# When does this run - new, reopened or updated PRs and when the workflow is called by | ||
# another workflow, such as the publishing actions. | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
workflow_call: | ||
|
||
|
||
jobs: | ||
# qa: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: "3.9" | ||
# - uses: pre-commit/[email protected] | ||
|
||
qa: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- uses: pre-commit/[email protected] | ||
|
||
|
||
test: | ||
# needs: qa | ||
needs: qa | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
python-version: [ "3.9" , "3.10", "3.11" ] | ||
python-version: [ "3.10", "3.11", "3.12" ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -39,21 +47,21 @@ jobs: | |
- name: Run tests | ||
run: poetry run pytest --cov-report xml | ||
|
||
- name: Upload coverage reports to Codecov | ||
id: codecov | ||
if: success() && (matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9) | ||
|
||
- name: Upload coverage to Codecov | ||
if: (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10') | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
docs_build: | ||
# needs: qa | ||
needs: qa | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
python-version: "3.10" | ||
|
||
- name: Install Poetry | ||
uses: abatilo/[email protected] | ||
|
@@ -64,4 +72,11 @@ jobs: | |
run: poetry install | ||
|
||
- name: Build docs using mkdocs | ||
run: poetry run mkdocs build --strict | ||
run: poetry run mkdocs build --strict | ||
|
||
- name: Check for file modifications due to docs build | ||
run: | | ||
if git status | grep -q "modified"; then | ||
echo "Docs build process has resulted in file changes." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Publishing | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
# First, run the standard test suite - for this to work correctly, the workflow needs | ||
# to inherit the organisation secrets used to authenticate to CodeCov. | ||
# https://github.com/actions/runner/issues/1413 | ||
test: | ||
uses: ./.github/workflows/sdv_ci.yaml | ||
secrets: inherit | ||
|
||
# Next, build the package wheel and source releases and add them to the release assets | ||
build-wheel: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Build the package - this could use `poetry build` directly but pyproject.toml | ||
# already has the build-system configured to use poetry so `pip` should pick that | ||
# up automatically. | ||
- name: Build sdist | ||
run: | | ||
python -m pip install --upgrade build | ||
python -m build | ||
# Upload the build outputs as job artifacts - these will be two files with x.y.z | ||
# version numbers: | ||
# - pyrealm-x.y.z-py3-none-any.whl | ||
# - pyrealm-x.y.z.tar.gz | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: dist/safedata_validator* | ||
|
||
# Add the built files to the release assets, alongside the repo archives | ||
# automatically added by GitHub. These files should then match exactly to the | ||
# published files on PyPI. | ||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
files: dist/safedata_validator* | ||
|
||
# Now attempt to publish the package to the TestPyPI site, where the pyrealm project | ||
# has been configured to allow trusted publishing from this repo and workflow. | ||
# | ||
# The skip-existing option allows the publication step to pass even when the release | ||
# files already exists on PyPI. That suggests something has gone wrong with the | ||
# release or the build file staging and the release should not be allowed to continue | ||
# to publish on PyPI. | ||
|
||
publish-TestPyPI: | ||
needs: build-wheel | ||
name: Publish safedata_validator to TestPyPI | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
# Download the built package files from the job artifacts | ||
- name: Download sdist artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
# Information step to show the contents of the job artifacts | ||
- name: Display structure of downloaded files | ||
run: ls -R dist | ||
|
||
# Use trusted publishing to release the files downloaded into dist to TestPyPI | ||
- name: Publish package distributions to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
# skip-existing: true | ||
|
||
# The final job in the workflow is to publish to the real PyPI as long as the release | ||
# name does not contain the tag 'test-pypi-only' | ||
publish-PyPI: | ||
if: ${{ ! contains(github.event.release.name, 'test-pypi-only')}} | ||
needs: publish-TestPyPI | ||
name: Publish safedata_validator to PyPI | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
# Download the built package files from the job artifacts | ||
- name: Download sdist artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
# Information step to show the contents of the job artifacts | ||
- name: Display structure of downloaded files | ||
run: ls -R dist | ||
|
||
# Use trusted publishing to release the files downloaded into dist to PyPI | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,27 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- repo: https://github.com/PyCQA/isort | ||
rev: "5.12.0" | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.6.2 | ||
hooks: | ||
- id: isort | ||
additional_dependencies: [toml] | ||
- repo: https://github.com/psf/black | ||
rev: "22.8.0" | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [flake8-docstrings] | ||
# Run the linter. | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
# Run the formatter. | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.991 | ||
rev: v1.11.2 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: | ||
- types-simplejson | ||
- types-python-dateutil | ||
- types-requests | ||
- repo: https://github.com/igorshubovych/markdownlint-cli | ||
rev: v0.37.0 | ||
rev: v0.41.0 | ||
hooks: | ||
- id: markdownlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.