Skip to content

Commit

Permalink
Only trigger on certain paths
Browse files Browse the repository at this point in the history
  • Loading branch information
olantwin committed Feb 2, 2023
1 parent 6651115 commit 15c2c60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 99 deletions.
102 changes: 3 additions & 99 deletions .github/workflows/matplotlib.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: CI
name: Matplotlib CI

on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
paths: ['src/matplotlib/**', 'examples/matplotlib/**']
pull_request:
branches: [ "main" ]
paths: ['src/matplotlib/**', 'examples/matplotlib/**']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -38,101 +40,3 @@ jobs:
name: matplotlib-example
path: ${{ github.workspace }}/examples/matplotlib/example.matplotlib.pdf
if-no-files-found: error

root-python-example:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}

steps:
- uses: actions/checkout@v3

- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
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: set up dependencies
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@v3
with:
name: root-python-example
path: ${{ github.workspace }}/examples/root/python/example.pyroot.pdf
if-no-files-found: error

root-cpp-example:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}

steps:
- uses: actions/checkout@v3

- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
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}
env
cd $GITHUB_WORKSPACE/examples/root/cpp
root -b -q example.C
- name: upload plot
uses: actions/upload-artifact@v3
with:
name: root-cpp-example
path: ${{ github.workspace }}/examples/root/cpp/example.root.pdf
if-no-files-found: error
2 changes: 2 additions & 0 deletions .github/workflows/root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
paths: ['src/root/**', 'conda.yml', 'examples/root/**']
pull_request:
branches: [ "main" ]
paths: ['src/root/**', 'conda.yml', 'examples/root/**']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down

0 comments on commit 15c2c60

Please sign in to comment.