Skip to content

Commit

Permalink
Merge pull request #15 from emiliobellini/hi_class
Browse files Browse the repository at this point in the history
new public version of hi_class (merged also latest Class)
  • Loading branch information
miguelzuma authored May 31, 2024
2 parents 16ae0f6 + 3d7b65e commit 50f447c
Show file tree
Hide file tree
Showing 1,853 changed files with 80,202 additions and 99,897 deletions.
148 changes: 148 additions & 0 deletions .github/workflows/test_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
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@v2
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@v2
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@v2
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 OMPFLAG="" -j
- name: Generate input files
run: |
source venv/bin/activate
cd main_class/python
TEST_LEVEL=3 CLASS_VERBOSE=1 nosetests -a dump_ini_files test_class.py
- 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 ': \
&& (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@v2
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@v2
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 OMPFLAG="" -j
- 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
- 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 ': \
&& (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@v2
with:
name: ValgrindOutputNarrowDeep
path: main_class/python/faulty_figs/valgrind_output
45 changes: 45 additions & 0 deletions .github/workflows/test_on_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Nosetests lvl2

on: [pull_request]

jobs:
nose_tests_lvl2:
runs-on: [self-hosted]

steps:
- name: Checkout 🛎
uses: actions/checkout@v2
with:
path: main_class
- name: Checkout reference 🛎
uses: actions/checkout@v2
with:
ref: devel
path: ref_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 classy
run: source venv/bin/activate && cd main_class && make -j
- name: make reference classy
run: |
source venv/bin/activate
cd ref_class
sed -i.bak "s/'classy'/'classyref'/g" python/setup.py
sed -i.bak 's/"classy"/"classyref"/g' python/setup.py
make -j
- name: Testing 🤖
run: |
source venv/bin/activate
cd main_class/python
OMP_NUM_THREADS=16 COMPARE_OUTPUT_REF=1 TEST_LEVEL=2 nosetests -v -a test_scenario test_class.py --nologcapture --nocapture
- name: Upload plots 📤
if: success() || failure()
uses: actions/upload-artifact@v2
with:
name: BranchVsMasterPlots
path: main_class/python/faulty_figs
40 changes: 40 additions & 0 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and light test

on: [push]

jobs:
build:
runs-on: [self-hosted]

steps:
- name: Checkout 🛎
uses: actions/checkout@v2
with:
path: main_class
- name: make
run: cd main_class && make -j class
- name: run class
run: cd main_class && ./class explanatory.ini

nose_tests_lvl1:
runs-on: [self-hosted]

steps:
- name: Checkout 🛎
uses: actions/checkout@v2
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 classy
run: source venv/bin/activate && cd main_class && make -j
- name: Testing 🤖
run: |
source venv/bin/activate
cd main_class/python
OMP_NUM_THREADS=16 TEST_LEVEL=1 nosetests -v -a test_scenario test_class.py --nologcapture --nocapture
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ class
*.prof
libclass.a
*out
*.gch
python/classy.c
python/*.pyc
python/build/i
ini_files
.vscode/
python/classy.cpp
*.pyc
python/build/
*.dSYM
RealSpaceInterface/cache/
.DS_Store
doc/manual/html
doc/manual/latex
*.gch
python/dist/
python/classy.egg-info/
Loading

0 comments on commit 50f447c

Please sign in to comment.