Skip to content

ci: automate release-note categorization with type labels #5374

ci: automate release-note categorization with type labels

ci: automate release-note categorization with type labels #5374

Workflow file for this run

name: Test build
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Test on ${{ matrix.platform }} with Python ${{ matrix.python-version }}${{ matrix.root-version != '' && format(' and ROOT {0}', matrix.root-version) || '' }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ['3.10', '3.14', 3.14 python-freethreading]
root-version: ['']
include:
- platform: ubuntu-latest
python-version: '3.10'
root-version: latest
- platform: ubuntu-latest
python-version: '3.10'
root-version: '6.32'
runs-on: ${{ matrix.platform }}
timeout-minutes: 30
# Required for miniconda to activate conda
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Get micromamba
uses: mamba-org/setup-micromamba@ce51e99f4bb8a82ab7158c4dc59ef4634c59c4f9 # v3.1.0
with:
environment-name: test-env
init-shell: bash
create-args: >-
--strict-channel-priority
conda-forge/label/python_rc::_python_rc
python=${{ matrix.python-version }}
${{ matrix.root-version == 'latest' && 'root' || matrix.root-version == '6.32' && 'root=6.32.*' || '' }}
micromamba-version: 2.6.0-0 # unpin when there is a release newer than 2.6.1-0
- name: Set PYTHON_GIL=0 for free-threaded builds
if: contains(matrix.python-version, 'python-freethreading')
run: echo "PYTHON_GIL=0" >> $GITHUB_ENV
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Check active Python version
env:
EXPECTED_PYTHON_VERSION: ${{ matrix.python-version }}
run: python -c "import os, sys; actual = '.'.join(str(s) for s in sys.version_info[:2]); expected = os.environ['EXPECTED_PYTHON_VERSION'].split()[0]; assert actual == expected, f'{actual} incorrect!'"
- name: Install sshd for fsspec ssh tests
if: runner.os == 'Linux'
run: |
sudo apt-get install -y openssh-server
sudo service ssh restart
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod og-wx ~/.ssh/authorized_keys
ssh-keyscan -H localhost >> ~/.ssh/known_hosts
ssh -o StrictHostKeyChecking=no localhost echo "ssh connection successful"
- name: Install XRootD
if: runner.os != 'Windows' && !contains(matrix.python-version, 'python-freethreading')
run: |
uv pip install --group=test-xrootd
- name: Pip install the package
run: uv pip install --system -e. --group=dev
- name: Run pytest
run: |
python -m pytest -vv tests --reruns 10 --reruns-delay 30 --only-rerun "(?i)http|ssl|timeout|expired|connection|socket"
vanilla-build:
name: Vanilla test on ${{ matrix.platform }} with Python ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.13']
runs-on: ${{ matrix.platform }}
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Pip install the package
run: uv pip install --system -e. --group=dev
- name: Run pytest
run: |
python -m pytest -vv tests --reruns 10 --reruns-delay 30 --only-rerun "(?i)http|ssl|timeout|expired|connection|socket"
numpy1-build:
name: NumPy 1 test on ${{ matrix.platform }} with Python ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.11']
runs-on: ${{ matrix.platform }}
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Pip install the package
run: |
uv venv
uv pip install -e. 'numpy<2' --group test
- name: Run pytest
run: |
uv run --no-sync pytest -vv tests --reruns 10 --reruns-delay 30 --only-rerun "(?i)http|ssl|timeout|expired|connection|socket"
pyodide-build:
name: Pyodide test
runs-on: ubuntu-latest
timeout-minutes: 30
env:
PYODIDE_VERSION: 0.29.4
PYODIDE_BUILD_VERSION: 0.34.4
AWKWARD_VERSION: v2.8.5
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.13'
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Install pyodide-build
run: python3 -m pip install pyodide-build==$PYODIDE_BUILD_VERSION
- name: Determine EMSDK version
id: compute-emsdk-version
run: |
pyodide config list
# Save EMSDK version
EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
echo "emsdk-version=$EMSCRIPTEN_VERSION" >> $GITHUB_OUTPUT
- name: Install EMSDK
uses: mymindstorm/setup-emsdk@4528d102f7230f0e7b276855c01ea1159be0e984 # v16
with:
version: ${{ steps.compute-emsdk-version.outputs.emsdk-version }}
- name: Build the package
run: pyodide build
- name: Build an awkward wheel compatible with the awkward-cpp version in pyodide
run: |
git clone --depth 1 --branch $AWKWARD_VERSION https://github.com/scikit-hep/awkward.git dependencies/awkward
pyodide build dependencies/awkward
rm -rf dependencies/
- name: Download Pyodide
uses: pyodide/pyodide-actions/download-pyodide@012fa537869d343726d01863a34b773fc4d96a14 # v2
with:
version: ${{ env.PYODIDE_VERSION }}
to: pyodide-dist
- name: Install browser
uses: pyodide/pyodide-actions/install-browser@012fa537869d343726d01863a34b773fc4d96a14 # v2
with:
runner: selenium
browser: chrome firefox
browser-version: latest
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: uv pip install --system -e. --group=test-pyodide pyodide-py==$PYODIDE_VERSION
- name: Run pytest (Chrome)
run: |
pytest -vv --dist-dir=./pyodide-dist/ --runner=selenium --runtime=chrome tests-wasm
- name: Run pytest (Firefox)
run: |
pytest -vv --dist-dir=./pyodide-dist/ --runner=selenium --runtime=firefox tests-wasm
gpu-build:
name: GPU test with CUDA ${{ matrix.cuda-version }}
strategy:
fail-fast: false
matrix:
cuda-version: [12, 13]
runs-on: self-hosted
timeout-minutes: 30
# Required for miniconda to activate conda
defaults:
run:
shell: bash -l {0}
steps:
- name: Clean the workspace and mamba
run: |
rm -rf * .[!.]* || echo "Nothing to clean"
rm -rf ~/micromamba* || echo "Nothing to clean"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Get micromamba
uses: mamba-org/setup-micromamba@ce51e99f4bb8a82ab7158c4dc59ef4634c59c4f9 # v3.1.0
with:
environment-name: test-env
init-shell: bash
create-args: >-
-c rapidsai
python=3.13
cuda-version=${{ matrix.cuda-version }}
cuda-toolkit
cuda-python
cccl-python
cupy
kvikio
nvcomp
pytest-cov
${{ matrix.cuda-version == 13 && 'root' || '' }}
- name: Pip install the package
run: pip install --group=dev --group=test-xrootd .
- name: Run only GPU tests
if: matrix.cuda-version != 13
run: |
python -m pytest -vv tests-cuda --reruns 10 --reruns-delay 30 --only-rerun "(?i)http|ssl|timeout|expired|connection|socket"
- name: Run full test suite and collect coverage
if: matrix.cuda-version == 13
run: |
python -m pytest -vv tests tests-cuda --reruns 10 --reruns-delay 30 --only-rerun "(?i)http|ssl|timeout|expired|connection|socket"\
--cov=uproot --cov-branch --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage reports to Codecov
if: matrix.cuda-version == 13
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() && matrix.cuda-version == 13 }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
pass:
name: Check required tests
if: always()
needs: [build, vanilla-build, numpy1-build, pyodide-build]
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}