Skip to content

chore: update test workflow #2699

chore: update test workflow

chore: update test workflow #2699

Workflow file for this run

name: Tests
on:
pull_request:
paths-ignore:
- README.md
- CONTRIBUTING.md
- CITATION.cff
- LICENSE
- .readthedocs.yml
- docs-img/**
- docs/**
- awkward-cpp/docs/**
- studies/**
schedule:
- cron: '0 12 1 * *'
workflow_dispatch:
concurrency:
group: 'test-${{ github.head_ref || github.run_id }}'
cancel-in-progress: true
env:
SOURCE_DATE_EPOCH: "1668811211"
jobs:
run-tests:
name: Run Tests
strategy:
fail-fast: false
matrix:
runs-on:
- windows-latest
- ubuntu-latest
- macos-12
python-version:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
python-architecture:
- x64
dependencies-kind:
- full
include:
- python-version: '3.9'
python-architecture: x86
runs-on: windows-latest
dependencies-kind: full
- python-version: '3.9'
python-architecture: x86
runs-on: windows-latest
dependencies-kind: numpy1
- python-version: '3.8'
python-architecture: x64
runs-on: ubuntu-latest
dependencies-kind: minimal
- python-version: 'pypy3.9'
python-architecture: x64
runs-on: ubuntu-latest
dependencies-kind: pypy
runs-on: ${{ matrix.runs-on }}
env:
PIP_ONLY_BINARY: numpy,pandas,pyarrow,numexpr,numexpr
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
allow-prereleases: true
- name: Upgrade pip and install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install pipx
- name: Generate build files
run: pipx run nox -s prepare -- --headers --signatures --tests
- name: Cache awkward-cpp wheel
id: cache-awkward-cpp-wheel
uses: actions/cache@v4
with:
path: awkward-cpp/dist
key: ${{ github.job }}-${{ matrix.runs-on }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}-${{ hashFiles('awkward-cpp/**') }}
- name: Build awkward-cpp wheel
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: |
python -m pip install build
python -m build -w awkward-cpp
- name: Find built wheel
uses: tj-actions/glob@v22
id: find-wheel
with:
files: awkward-cpp/dist/*.whl
- name: Install awkward, awkward-cpp, and dependencies
run: |
python -m pip install -v . ${{ steps.find-wheel.outputs.paths }} pytest-github-actions-annotate-failures
-r requirements-test-${{ matrix.dependencies-kind }}.txt
- name: Print versions
run: python -m pip list
- name: Check if kernel specification is sorted
if: matrix.python-version == '3.12' && matrix.runs-on == 'ubuntu-latest'
run: pipx run nox -s diagnostics -- --check-spec-sorted
- name: Test specification
run: python -m pytest -vv -rs awkward-cpp/tests-spec
- name: Test specification with explicitly defined values
run: python -m pytest -vv -rs awkward-cpp/tests-spec-explicit
- name: Test CPU kernels
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels
- name: Test CPU kernels with explicitly defined values
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels-explicit
- name: Test non-kernels (Python)
run: |
python -m pytest -vv -rs tests --cov=awkward --cov-report=term
--cov-report=xml
if: startsWith(matrix.python-version, '3.')
- name: Test non-kernels (PyPy)
run: python -m pytest -vv -rs tests
if: startsWith(matrix.python-version, 'pypy')
- name: Upload Codecov results
if: matrix.python-version == '3.9' && matrix.runs-on == 'ubuntu-latest'
uses: codecov/codecov-action@v4
Linux-ROOT:
runs-on: ubuntu-20.04
env:
PIP_ONLY_BINARY: numpy,pandas,pyarrow,numexpr,numexpr
timeout-minutes: 30
defaults:
run:
shell: "bash -l {0}"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python via Conda
uses: mamba-org/setup-micromamba@v1
with:
cache-environment: true
environment-name: awkward
create-args: |
python=3.8
numpy
root
- name: Upgrade pip and install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install pipx
- name: Generate build files
run: pipx run nox -s prepare -- --headers --signatures --tests
- name: Cache awkward-cpp wheel
id: cache-awkward-cpp-wheel
uses: actions/cache@v4
with:
path: ./awkward-cpp/dist
key: ${{ github.job }}-${{ hashFiles('awkward-cpp/**') }}
- name: Build awkward-cpp wheel
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: |
python3 -m pip install build
python3 -m build -w ./awkward-cpp
- name: Install awkward, awkward-cpp, and dependencies
run: |
python -m pip install --only-binary "numpy,pandas,pyarrow,numexpr"
-v . ./awkward-cpp/dist/*.whl
pytest-github-actions-annotate-failures
-r requirements-test-full.txt
- name: Print versions
run: python -m pip list
- name: Test
run: python -m pytest -vv -rs tests
Linux-cppyy:
runs-on: ubuntu-22.04
env:
PIP_ONLY_BINARY: numpy,pandas,pyarrow,numexpr,numexpr
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Upgrade pip and install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install pipx
- name: Generate build files
run: pipx run nox -s prepare -- --headers --signatures --tests
- name: Cache awkward-cpp wheel
id: cache-awkward-cpp-wheel
uses: actions/cache@v4
with:
path: ./awkward-cpp/dist
key: ${{ github.job }}-${{ hashFiles('awkward-cpp/**') }}
- name: Build awkward-cpp wheel
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
run: |
python -m pip install build
python -m build -w ./awkward-cpp
- name: Extract pre-built manylinux cppyy wheels
uses: shrink/actions-docker-extract@v3
with:
image: "docker.io/agoose77/cppyy-wheels:cp311"
path: "/wheels/."
destination: "/tmp/wheelhouse"
- name: Install awkward, awkward-cpp, and dependencies
run: |
python -m pip install -v --only-binary "numpy,pandas,pyarrow,numexpr"
./ ./awkward-cpp/dist/*.whl /tmp/wheelhouse/* pytest-github-actions-annotate-failures
- name: Print versions
run: python -m pip list
- name: Test
run: python -m pytest -vv -rs tests -k cppyy