Skip to content

switch to miniforge (Mambaforge is deprecated) #26

switch to miniforge (Mambaforge is deprecated)

switch to miniforge (Mambaforge is deprecated) #26

Workflow file for this run

# CI handling ROOT (C++) and pyROOT
name: ROOT CI
on:
# Trigger the workflow on push or pull request events but only for the "main" branch,
# for given paths
push:
branches: [ "main" ]
paths: ['src/root/**', 'conda.yml', 'examples/root/**']
pull_request:
branches: [ "main" ]
paths: ['src/root/**', 'conda.yml', 'examples/root/**']
# Allow manual dispatch
workflow_dispatch:
jobs:
root-python-example:
# PyROOT example
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0} # needed for conda
steps:
# Check-out repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- name: Setup miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: CI
use-mamba: true
- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{
hashFiles('conda.yml') }}-${{ env.CACHE_NUMBER
}}
env:
# Increase this value to reset cache if conda.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run: mamba env update -n CI -f conda.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Install package
run: |
pip install $GITHUB_WORKSPACE
- name: Create ROOT example plot using python
run: |
cd $GITHUB_WORKSPACE/examples/root/python
python3 example.py
- name: Upload plot
uses: actions/upload-artifact@v4
with:
name: root-python-example
path: ${{ github.workspace }}/examples/root/python/example.pyroot.pdf
if-no-files-found: error
root-cpp-example:
# ROOT C++ example
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0} # needed for conda
steps:
# Check-out repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- name: Setup miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: CI
use-mamba: true
- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{
hashFiles('conda.yml') }}-${{ env.CACHE_NUMBER
}}
env:
# Increase this value to reset cache if conda.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run: mamba env update -n CI -f conda.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Create ROOT example plot using C++
run: |
export ROOT_INCLUDE_PATH=$GITHUB_WORKSPACE/src/root/cpp/include:${ROOT_INCLUDE_PATH}
cd $GITHUB_WORKSPACE/examples/root/cpp
root -b -q example.C
- name: Upload plot
uses: actions/upload-artifact@v4
with:
name: root-cpp-example
path: ${{ github.workspace }}/examples/root/cpp/example.root.pdf
if-no-files-found: error