Skip to content

CI

CI #774

Workflow file for this run

name: CI
on:
push:
schedule:
- cron: '0 1 * * *' # Test every day at 1AM
jobs:
# Based on https://github.com/py-actions/flake8#quick-start
Check-flake8-lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v4
- name: flake8 Lint
uses: py-actions/flake8@v2
with:
exclude: "./topcoffea/modules/WCFit.py,./topcoffea/modules/WCPoint.py"
ignore: "E116,E201,E202,E203,E211,E221,E222,E226,E225,E227,E228,E231,E241,E251,E261,E262,E265,E266,E271,E272,E301,E302,E303,E305,E402,F403,F405,E501,W504,E701,E702,E711,E713,E714,E722,E731,E741,F841,W391,W605"
Check-topcoffea-mamba:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: topcoffea-env
init-shell: >-
bash
- name: Install pip packages
run: |
pip install -e .
shell: micromamba-shell {0}
- name: Pytest setup
run: |
micromamba install -y -n topcoffea-env -c conda-forge pytest
shell: bash -el {0}
- name: Test update json
run: |
pytest tests/test_update_json.py
shell: micromamba-shell {0}
- name: Test HistEFT unit test
run: |
pytest tests/test_unit.py
shell: micromamba-shell {0}
- name: Test histEFT
run: |
pytest tests/test_HistEFT_add.py
shell: micromamba-shell {0}
Check-topcoffea:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- name: Install dependencies
run: |
conda config --set channel_priority strict
conda config --add channels conda-forge
conda env create -f environment.yml -n topcoffea-env
- name: Conda list
run: |
conda list -n topcoffea-env
- name: Install pip packages
run: |
conda run -n topcoffea-env pip install -e .
- name: Pytest setup
run: |
conda install -y -n topcoffea-env -c conda-forge pytest
- name: Test update json
run: |
conda run -n topcoffea-env pytest tests/test_update_json.py
- name: Test HistEFT unit test
run: |
conda run -n topcoffea-env pytest tests/test_unit.py
- name: Test histEFT
run: |
conda run -n topcoffea-env pytest tests/test_HistEFT_add.py