Skip to content

Bump the actions group in /.github/workflows with 2 updates #27

Bump the actions group in /.github/workflows with 2 updates

Bump the actions group in /.github/workflows with 2 updates #27

Workflow file for this run

name: integration-matrix
on:
schedule:
- cron: '0 6 * * 0' # Sundays at 06:00 UTC
workflow_dispatch:
pull_request:
permissions:
contents: write # to push gh-pages on main / schedule / dispatch
pull-requests: none # explicit: this workflow never touches PRs
concurrency:
# One in-flight run per PR, one per main/dispatch invocation.
# PR runs cancel previous in-progress ones; main runs queue.
group: integration-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# Read the `columns` list from packages.yaml and emit it as the job
# matrix, so the (python, variant) combinations have a single source
# of truth and never need hand-syncing into this workflow.
setup:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
matrix: ${{ steps.columns.outputs.matrix }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.12'
- name: Build matrix from packages.yaml
id: columns
run: |
pip install pyyaml
python -c '
import json, yaml
cols = yaml.safe_load(open("packages.yaml"))["columns"]
matrix = [{"python": str(c["python"]), "variant": c["variant"]} for c in cols]
print("matrix=" + json.dumps(matrix))
' >> "$GITHUB_OUTPUT"
variant:
needs: setup
strategy:
fail-fast: false
matrix:
# Generated by the `setup` job from `columns:` in packages.yaml;
# each entry is one {python, variant} object.
include: ${{ fromJson(needs.setup.outputs.matrix) }}
runs-on: ubuntu-latest
timeout-minutes: 240
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
# This Python only runs the `astropy-integration` orchestrator CLI;
# the test venv for `matrix.python` is built separately by uv (see
# the `run` step below), so a fixed version is fine here.
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
# We manage the cache ourselves via actions/cache below; turning
# off setup-uv's own caching avoids it saving a duplicate of the
# same directory under its own key.
enable-cache: false
- name: Cache ~/.cache/uv
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/uv
# Primary key uses the run id, so every run writes a fresh
# snapshot (after `uv cache prune --ci` slims it to wheels
# actually used in this run). The restore-keys are prefix
# matches against saved keys, so the first one always finds
# the most recent run's cache for the same (os, variant,
# python) and the next run starts warm.
key: uv-${{ runner.os }}-${{ matrix.variant }}-${{ matrix.python }}-${{ github.run_id }}
restore-keys: |
uv-${{ runner.os }}-${{ matrix.variant }}-${{ matrix.python }}-
uv-${{ runner.os }}-${{ matrix.variant }}-
uv-${{ runner.os }}-
- name: Install astropy-integration
run: pip install .
- name: Run ${{ matrix.variant }} variant on Python ${{ matrix.python }}
env:
# PR previews limit each package to the first 10 tests so the
# matrix finishes in minutes; conftest.py at the repo root reads
# this env var and truncates the collected items.
PYTEST_LIMIT_N: ${{ github.event_name == 'pull_request' && '10' || '' }}
run: astropy-integration run --variant ${{ matrix.variant }} --python ${{ matrix.python }}
- name: Prune uv cache before save
if: always()
# Strips pre-built sdists and other entries uv won't reuse, so
# the snapshot the cache step uploads stays lean.
run: uv cache prune --ci
- name: Upload results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: results-${{ matrix.variant }}-${{ matrix.python }}
path: results/${{ matrix.variant }}__${{ matrix.python }}.json
dashboard:
needs: variant
if: always()
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.12'
- name: Install astropy-integration
run: pip install .
- name: Download all variant results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: results-*
merge-multiple: true
path: results/
- name: Build dashboard
run: astropy-integration dashboard
# PR path: upload index.html as a non-zipped artifact for the
# in-browser preview (linked from a PR check by preview-link.yml).
- name: Upload preview artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dashboard-preview
path: site/index.html
archive: false
overwrite: true
# Main / schedule / dispatch path: publish to gh-pages.
- name: Publish to gh-pages
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
force_orphan: true
commit_message: Update integration dashboard