-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (86 loc) · 2.85 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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