CI #241
This file contains hidden or 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
# Main CI Workflow | |
name: CI | |
on: | |
push: | |
branches: | |
- 'main' | |
- '*.*' | |
- '!*backport*' | |
tags: | |
- 'v*' | |
- '!*dev*' | |
- '!*pre*' | |
- '!*post*' | |
pull_request: | |
# Allow manual runs through the web UI | |
workflow_dispatch: | |
# Trigger on completion of the scheduled_builds.yml file (only on main) | |
workflow_run: | |
workflows: [Scheduled build triggerer] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
core: | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 | |
with: | |
submodules: false | |
coverage: codecov | |
toxdeps: tox-pypi-filter | |
posargs: -n auto --color=yes | |
envs: | | |
- linux: py313 | |
libraries: | |
apt: | |
- libopenjp2-7 | |
secrets: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
test: | |
needs: [core] | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 | |
with: | |
submodules: false | |
coverage: codecov | |
toxdeps: tox-pypi-filter | |
posargs: -n auto --color=yes | |
envs: | | |
- windows: py312 | |
- macos: py311 | |
libraries: | |
brew: | |
- openjpeg | |
- linux: py311-oldestdeps | |
libraries: | |
apt: | |
- libopenjp2-7 | |
secrets: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
docs: | |
needs: [core] | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 | |
with: | |
default_python: '3.12' | |
submodules: false | |
pytest: false | |
toxdeps: tox-pypi-filter | |
cache-path: | | |
docs/_build/ | |
docs/generated/ | |
.tox/sample_data/ | |
cache-key: docs-${{ github.run_id }} | |
envs: | | |
- linux: build_docs | |
libraries: | |
apt: | |
- libopenjp2-7 | |
- graphviz | |
online: | |
if: "!startsWith(github.event.ref, 'refs/tags/v')" | |
needs: [docs] | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 | |
with: | |
default_python: '3.12' | |
submodules: false | |
coverage: codecov | |
toxdeps: tox-pypi-filter | |
envs: | | |
- linux: build_docs-gallery | |
pytest: false | |
cache-path: | | |
docs/_build/ | |
docs/generated/ | |
.tox/sample_data/ | |
cache-key: docs-${{ github.run_id }} | |
libraries: | |
apt: | |
- libopenjp2-7 | |
- graphviz | |
- linux: py312-online | |
posargs: -n auto --dist loadgroup --color=yes | |
libraries: | |
apt: | |
- libopenjp2-7 | |
secrets: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
publish: | |
# Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.* | |
# see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi | |
if: | | |
github.event_name != 'pull_request' || | |
( | |
github.event_name == 'pull_request' && | |
contains(github.event.pull_request.labels.*.name, 'Run publish') | |
) | |
needs: [test, docs] | |
uses: sunpy/github-actions-workflows/.github/workflows/publish.yml@main | |
with: | |
upload_to_anaconda: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }} | |
anaconda_user: scientific-python-nightly-wheels | |
anaconda_package: sunpy | |
anaconda_keep_n_latest: 1 | |
sdist: false | |
test_extras: 'tests' | |
test_command: 'pytest -p no:warnings --doctest-rst --pyargs sunpy' | |
submodules: false | |
targets: | | |
- cp3{11,12,13}-macosx_arm64 | |
- cp3{11,12,13}-macosx_x86_64 | |
- target: cp3{11,12,13}-manylinux_aarch64 | |
runs-on: ubuntu-24.04-arm | |
- cp3{11,12,13}-manylinux_x86_64 | |
secrets: | |
pypi_token: ${{ secrets.pypi_token }} | |
anaconda_token: ${{ secrets.anaconda_org_upload_token }} | |
publish_pure: | |
needs: [publish] | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v2 | |
with: | |
python-version: "3.12" | |
test_extras: 'tests' | |
test_command: 'pytest -p no:warnings --doctest-rst -m "not mpl_image_compare" --pyargs sunpy' | |
submodules: false | |
env: | | |
SUNPY_NO_BUILD_ANA_EXTENSION: 1 | |
secrets: | |
pypi_token: ${{ secrets.pypi_token }} | |
notify: | |
if: always() && (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_run') | |
needs: [publish_pure, online] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: Cadair/matrix-notify-action@main | |
with: | |
matrix_token: ${{ secrets.matrix_access_token }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
homeserver: ${{ secrets.matrix_homeserver }} | |
roomid: '!JYqfIVJjWANcHnfktY:cadair.com' | |
ignore_pattern: '.*Load.*' | |
summarise_success: true |