Skip to content

Bump mamba-org/provision-with-micromamba from 15 to 16 #463

Bump mamba-org/provision-with-micromamba from 15 to 16

Bump mamba-org/provision-with-micromamba from 15 to 16 #463

Workflow file for this run

name: tests
#Running tests on all branches
on:
push:
pull_request:
branches:
- main
workflow_dispatch:
# Needed for micromamba pickup
defaults:
run:
shell: bash -l {0}
jobs:
test:
# Setup the Python that the ROOT binary was built against
runs-on: ${{ matrix.os }}
# On push events run the CI only on main by default, but run on any branch if the commit message contains '[ci all]'
if: >-
github.event_name != 'push'
|| (github.event_name == 'push' && github.ref == 'refs/heads/main')
|| (github.event_name == 'push' && github.ref != 'refs/heads/main' && contains(github.event.head_commit.message, '[ci all]'))
strategy:
matrix:
os: [ubuntu-latest]
root-version: ["6.24", "6.26", "6.28"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
exclude:
- root-version: "6.24"
python-version: "3.10"
- root-version: "6.26"
python-version: "3.6"
- root-version: "6.26"
python-version: "3.7"
- root-version: "6.28"
python-version: "3.6"
- root-version: "6.28"
python-version: "3.7"
include:
- os: macos-latest
root-version: "6.28"
python-version: "3.10"
steps:
- uses: actions/checkout@v4
- name: Setup Micromamba environment
uses: mamba-org/provision-with-micromamba@v16
with:
environment-file: false
environment-name: ci
extra-specs: |
python=${{ matrix.python-version }}
root=${{ matrix.root-version }}
imagemagick
ghostscript
pip
channels: conda-forge
- name: ROOT info
run: |
root-config --version
root-config --python-version
# Install dependencies
- name: Install python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade \
'pylint==2.9.6' \
pytest_pylint \
configparser \
astroid \
pyyml \
papermill \
nbconvert \
jupyter \
pytest \
pytest-cov
- name: Install hepdata_lib
run: python -m pip install '.[test]'
# Use python -m pytest to add current working dir as src/ dir layout not used
- name: Run pytest
run: |
python -m pytest tests
- name: Report coverage with Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: unittests-${{ matrix.python-version }}
- name: Save notebooks
if: ${{ always() }}
run: |
python -m jupyter kernelspec list
python -m jupyter nbconvert --ExecutePreprocessor.timeout=600 --ExecutePreprocessor.allow_errors=True --to html --execute examples/*.ipynb
- name: Upload notebooks
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: notebooks py3
path: examples/*.html
- name: Run pylint
if: ${{ always() }}
run: |
python -m pylint hepdata_lib/*.py
python -m pylint tests/*.py --rcfile=tests/pylintrc