Files

123 lines
4.6 KiB
YAML

name: Tool framework tests
on:
push:
paths:
- '**'
- '!client/**'
- '!doc/**'
- '!lib/galaxy_test/selenium/**'
- '!packages/test_selenium/**'
- '!.github/workflows/**'
- '.github/workflows/framework_tools.yaml'
- '.github/workflows/_report_scheduled_result.yaml'
pull_request:
paths:
- '**'
- '!client/**'
- '!doc/**'
- '!lib/galaxy_test/selenium/**'
- '!packages/test_selenium/**'
- '!.github/workflows/**'
- '.github/workflows/framework_tools.yaml'
- '.github/workflows/_report_scheduled_result.yaml'
schedule:
# Run at midnight UTC every Tuesday, with extended metadata; this cron string is also matched below.
- cron: '0 0 * * 2'
# Run the legacy tool API too at 02:17 UTC daily
- cron: '17 2 * * *'
workflow_dispatch:
env:
GALAXY_TEST_DBURI: 'postgresql+psycopg://postgres:postgres@localhost:5432/galaxy?client_encoding=utf8'
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
UV_HTTP_RETRIES: '6'
concurrency:
# Keep pushes to dev, and the two schedules, from cancelling each other.
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.schedule }}-${{ 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:
python-version: ['3.11']
# Pull requests and pushes to dev test only the tool request API. Release branches get no nightly run,
# so they keep the legacy API too.
use-legacy-api: >-
${{ fromJSON(
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || startsWith(github.base_ref || github.ref_name, 'release_'))
&& '["never", "always"]'
|| '["never"]'
) }}
services:
postgres:
image: postgres:18
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
steps:
- if: github.event.schedule == '0 0 * * 2'
run: |
echo "GALAXY_CONFIG_OVERRIDE_METADATA_STRATEGY=extended" >> $GITHUB_ENV
echo "GALAXY_CONFIG_OVERRIDE_OUTPUTS_TO_WORKING_DIRECTORY=true" >> $GITHUB_ENV
- 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 Python
run: uv python install
- name: Run tests
run: ./run_tests.sh --framework-tools -- -n 4
env:
GALAXY_TEST_USE_LEGACY_TOOL_API: ${{ matrix.use-legacy-api }}
# Coverage slows the tests down; collect it for pushes only, so nightly runs don't skew dev coverage.
GALAXY_TEST_COVERAGE: ${{ github.event_name == 'push' && '1' || '' }}
# Each xdist worker has its own conda prefix, so a tool's first run builds its conda
# environment on a busy runner.
GALAXY_TEST_DEFAULT_WAIT: '180'
working-directory: 'galaxy root'
- uses: codecov/codecov-action@v7.1.1
if: github.event_name == 'push'
with:
flags: framework
working-directory: 'galaxy root'
- uses: actions/upload-artifact@v7
if: failure()
with:
name: Tool framework test results (${{ matrix.python-version }}, ${{ matrix.use-legacy-api }})
path: 'galaxy root/run_framework_tests.html'
report:
needs: [test]
# The Tuesday extended-metadata run stays untracked, as before.
if: >-
${{ !cancelled()
&& (github.event_name == 'workflow_dispatch' || (github.event_name == 'schedule' && github.event.schedule != '0 0 * * 2')) }}
permissions:
actions: read
issues: write
uses: $/.github/workflows/_report_scheduled_result.yaml
with:
title: Scheduled tool framework tests are failing
labels: area/tool-framework, area/testing, kind/bug
description: |-
The nightly run of the tool framework tests against both the tool request API and the legacy tool API failed.
Pull requests to dev run the tool framework tests against the tool request API only; nightly runs cover both APIs. Release branches and the Tuesday extended-metadata run also retain both APIs.
needs: ${{ toJSON(needs) }}