mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-11-25 17:02:30 +08:00
The scheduled and `workflow_dispatch` `python-version` matrix in
`unit.yaml` and `toolshed.yaml` listed `"3.11"` twice, so every
nightly run executed identical jobs for Python 3.11 (two extra jobs for
the Tool Shed tests, crossed with `test-install-client`), and their
failure artifacts would have collided on the same name.
https://github.com/galaxyproject/galaxy/pull/24131 added these
matrices to dev as `["3.10", "3.11", "3.12", "3.13", "3.14"]`. When
`release_26.2`, which drops support for Python 3.10, was merged into dev
in aa0f6246b8, the conflict resolution replaced `"3.10"` with `"3.11"`,
duplicating the existing entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
106 lines
3.8 KiB
YAML
106 lines
3.8 KiB
YAML
name: Unit tests
|
|
on:
|
|
push:
|
|
paths:
|
|
- '**'
|
|
- '!client/**'
|
|
- '!doc/**'
|
|
- '!lib/galaxy_test/selenium/**'
|
|
- '!packages/test_selenium/**'
|
|
- '!.github/workflows/**'
|
|
- '.github/workflows/unit.yaml'
|
|
- '.github/workflows/_report_scheduled_result.yaml'
|
|
pull_request:
|
|
paths:
|
|
- '**'
|
|
- '!client/**'
|
|
- '!doc/**'
|
|
- '!lib/galaxy_test/selenium/**'
|
|
- '!packages/test_selenium/**'
|
|
- '!.github/workflows/**'
|
|
- '.github/workflows/unit.yaml'
|
|
- '.github/workflows/_report_scheduled_result.yaml'
|
|
schedule:
|
|
# Run every supported Python version at 00:17 UTC daily
|
|
- cron: '17 0 * * *'
|
|
workflow_dispatch:
|
|
env:
|
|
UV_HTTP_RETRIES: '6'
|
|
concurrency:
|
|
# Keep pushes to dev from cancelling the scheduled run.
|
|
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
permissions: {}
|
|
jobs:
|
|
test:
|
|
if: >-
|
|
github.event_name != 'push'
|
|
|| github.repository_owner != 'galaxyproject'
|
|
|| github.ref_name == 'dev'
|
|
|| startsWith(github.ref_name, 'release_')
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# Pull requests and pushes to dev run only the newest Python; ruff and mypy catch most code too new for the oldest.
|
|
# Release branches get no nightly run, so they keep the oldest and newest.
|
|
python-version: >-
|
|
${{ fromJSON(
|
|
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && '["3.11", "3.12", "3.13", "3.14"]'
|
|
|| startsWith(github.base_ref || github.ref_name, 'release_') && '["3.11", "3.14"]'
|
|
|| '["3.14"]'
|
|
) }}
|
|
steps:
|
|
- uses: actions/checkout@v7.0.1
|
|
with:
|
|
path: 'galaxy root'
|
|
persist-credentials: false
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v10.3.3
|
|
with:
|
|
version-file: galaxy root/.tool-versions
|
|
python-version: ${{ matrix.python-version }}
|
|
prune-cache: true
|
|
- name: Install ffmpeg and bubblewrap
|
|
# bubblewrap: exercises the expression-evaluation isolation sandbox tests.
|
|
# Ubuntu >=24.04 restricts unprivileged user namespaces (which bwrap needs);
|
|
# allow them so the sandbox test can run.
|
|
run: |
|
|
sudo apt-get update && sudo apt-get -y install ffmpeg bubblewrap
|
|
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
|
|
- name: Install tox
|
|
run: uv tool install tox --with tox-uv
|
|
- name: Run tests
|
|
run: tox -e "$TOX_ENV"
|
|
env:
|
|
PYTEST_ADDOPTS: -n 4
|
|
# Coverage slows the tests down; collect it for pushes only, so nightly runs don't skew dev coverage.
|
|
TOX_ENV: ${{ github.event_name == 'push' && 'unit-coverage' || 'unit' }}
|
|
working-directory: 'galaxy root'
|
|
- uses: codecov/codecov-action@v7.1.1
|
|
if: github.event_name == 'push'
|
|
with:
|
|
flags: py-unit
|
|
working-directory: 'galaxy root'
|
|
- uses: actions/upload-artifact@v7
|
|
if: failure()
|
|
with:
|
|
name: Unit test results (${{ matrix.python-version }})
|
|
path: 'galaxy root/run_unit_tests.html'
|
|
report:
|
|
needs: [test]
|
|
if: ${{ !cancelled() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }}
|
|
permissions:
|
|
actions: read
|
|
issues: write
|
|
uses: $/.github/workflows/_report_scheduled_result.yaml
|
|
with:
|
|
title: Scheduled unit tests are failing
|
|
labels: area/testing, kind/bug
|
|
description: |-
|
|
The nightly run of the Python unit tests across every supported Python version failed.
|
|
|
|
Pull requests to dev run the unit tests on the newest Python only; nightly runs cover every supported version. Release branches retain the oldest and newest versions.
|
|
needs: ${{ toJSON(needs) }}
|