-
Notifications
You must be signed in to change notification settings - Fork 291
160 lines (154 loc) · 5.26 KB
/
test_nightly.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Nosetests and Valgrind
# To run this workflow on other branches than devel, uncomment line 4 and comment line 5-7.
#on: [push]
on:
schedule:
- cron: '0 20 * * *' # Daily at UTC 20:00
jobs:
iftest:
runs-on: [self-hosted]
outputs:
should_run: ${{ steps.store_output.outputs.SHOULD_RUN }}
steps:
- name: Store output
id: store_output
env:
SHA_LAST_SUCCESS: ${{ secrets.SHA_LAST_SUCCESS }}
run: |
if [ "$SHA_LAST_SUCCESS" == "${{ github.sha }}" ]; then
echo "::set-output name=SHOULD_RUN::0"
else
echo "::set-output name=SHOULD_RUN::1"
fi
conclude:
runs-on: [self-hosted]
needs: [nose_tests_lvl3, valgrind-wide-and-shallow, valgrind-narrow-and-deep]
steps:
- name: Store current SHA as secret
uses: hmanzur/[email protected]
with:
name: 'SHA_LAST_SUCCESS'
value: ${{ github.sha }}
repository: lesgourg/class
token: ${{ secrets.REPO_ACCESS_TOKEN }}
nose_tests_lvl3:
runs-on: [self-hosted]
needs: iftest
if: needs.iftest.outputs.should_run > 0
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
with:
path: main_class
- name: Create or update virtual Python environment
run: |
rm -f venv/bin/python
virtualenv venv
source venv/bin/activate
pip install --upgrade pip
pip install numpy scipy pandas matplotlib cython nose parameterized
- name: make
run: cd main_class && make -j
- name: Testing 🤖
run: |
source venv/bin/activate
cd main_class/python
OMP_NUM_THREADS=32 COMPARE_OUTPUT_GAUGE=1 TEST_LEVEL=3 nosetests -v -a test_scenario test_class.py --nologcapture --nocapture
- name: Upload plots 📤
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ComparePlots
path: main_class/python/faulty_figs
valgrind-wide-and-shallow:
runs-on: [self-hosted]
needs: iftest
if: needs.iftest.outputs.should_run > 0
timeout-minutes: 1440
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
with:
path: main_class
- name: Create or update virtual Python environment
run: |
rm -rf venv
virtualenv venv
source venv/bin/activate
pip install --upgrade pip
pip install numpy scipy pandas matplotlib cython nose parameterized
deactivate
- name: make
run: |
source venv/bin/activate
cd main_class
make -j
deactivate
- name: Generate input files
run: |
source venv/bin/activate
cd main_class/python
TEST_LEVEL=3 VALGRIND_MODE=1 CLASS_VERBOSE=1 python "$(which nosetests)" -a dump_ini_files test_class.py
deactivate
- name: Valgrind 🤖
run: |
cd main_class/python/faulty_figs
rm -rf output && mkdir output
rm -rf valgrind_output && mkdir valgrind_output
cp ../../class .
find . -name "*.ini" -type f -print0 | xargs -0 -I {} -n 1 -P 32 bash -c ': \
&& printf "\nk_step_sub = 10.0\nk_step_super = 0.4\nk_per_decade_for_pk = 2\nk_per_decade_for_bao = 5\n" >> {}'
find . -name "*.ini" -type f -print0 | xargs -0 -I {} -n 1 -P 32 bash -c ': \
&& (OMP_NUM_THREADS=1 valgrind --track-origins=yes --show-leak-kinds=all --leak-check=full --error-exitcode=3 ./class {} &> {}.out && echo {} "...ok") \
|| (echo {} "...fail" && cp {}* valgrind_output && exit 3)'
- name: Upload errors 📤
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ValgrindOutputWideShallow
path: main_class/python/faulty_figs/valgrind_output
valgrind-narrow-and-deep:
runs-on: [self-hosted]
needs: iftest
if: needs.iftest.outputs.should_run > 0
timeout-minutes: 1440
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
with:
path: main_class
- name: Create or update virtual Python environment
run: |
rm -rf venv
virtualenv venv
source venv/bin/activate
pip install --upgrade pip
pip install numpy scipy pandas matplotlib cython nose parameterized
deactivate
- name: make
run: |
source venv/bin/activate
cd main_class
make -j
deactivate
- name: Generate input files
run: |
source venv/bin/activate
cd main_class/python
TEST_LEVEL=1 CLASS_VERBOSE=1 nosetests -a dump_ini_files test_class.py
deactivate
- name: Valgrind 🤖
run: |
cd main_class/python/faulty_figs
rm -rf output && mkdir output
rm -rf valgrind_output && mkdir valgrind_output
cp ../../class .
find . -name "*.ini" -type f -print0 | xargs -0 -I {} -n 1 -P 32 bash -c ': \
&& (OMP_NUM_THREADS=1 valgrind --track-origins=yes --show-leak-kinds=all --leak-check=full --error-exitcode=3 ./class {} &> {}.out && echo {} "...ok") \
|| (echo {} "...fail" && cp {}* valgrind_output && exit 3)'
- name: Upload errors 📤
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ValgrindOutputNarrowDeep
path: main_class/python/faulty_figs/valgrind_output