-
Notifications
You must be signed in to change notification settings - Fork 7
164 lines (158 loc) · 5.37 KB
/
ci.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
161
162
163
name: firecrown-ci
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
schedule:
- cron: '47 1 * * *'
jobs:
firecrown-miniforge:
name: Firecrown (${{ matrix.os }}, python-${{ matrix.python-version }}, Miniforge)
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: ["ubuntu", "macos"]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Setup miniforge
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: firecrown_developer
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
show-channel-urls: true
use-mamba: true
- name: Cache date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key: miniforge-${{ runner.os }}--${{ runner.arch }}--python-${{ matrix.python-version }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER }}
env:
CACHE_NUMBER: 0
id: cache
- name: Update environment
run: |
conda env update -q -v -n firecrown_developer -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Setting up Firecrown
shell: bash -l {0}
run: |
export FIRECROWN_DIR=${PWD}
conda env config vars set FIRECROWN_DIR=${FIRECROWN_DIR}
conda activate firecrown_developer
pip install --no-deps -e .
- name: Setting up CosmoSIS
shell: bash -l {0}
run: |
source ${CONDA_PREFIX}/bin/cosmosis-configure
pushd ${CONDA_PREFIX}
cosmosis-build-standard-library
export CSL_DIR=${PWD}/cosmosis-standard-library
conda env config vars set CSL_DIR=${CSL_DIR}
conda activate firecrown_developer
if: steps.cache.outputs.cache-hit != 'true'
- name: Setting up Cobaya
shell: bash -l {0}
run: python -m pip install cobaya
if: steps.cache.outputs.cache-hit != 'true'
- name: Ensure clear Jupyter Notebooks
uses: ResearchSoftwareActions/EnsureCleanNotebooksAction@1.1
- name: Running black check
shell: bash -l {0}
run: |
black --check firecrown
black --check tests
black --check examples
- name: Running flake8
shell: bash -l {0}
run: |
flake8 firecrown
flake8 examples
flake8 tests
- name: Running mypy
shell: bash -l {0}
run: |
mypy -p firecrown
mypy -p examples
mypy -p tests
- name: Running pylint
shell: bash -l {0}
run: |
pylint --rcfile tests/pylintrc tests
pylint --rcfile firecrown/models/pylintrc firecrown/models
pylint firecrown
- name: Running pytest
shell: bash -l {0}
run: python -m pytest -vv
- name: Running example - cosmosis - cosmic-shear
shell: bash -l {0}
run: |
cd examples/cosmicshear
python generate_cosmicshear_data.py
cosmosis cosmicshear.ini
- name: Running example - cosmosis - des-y1-3x2pt
shell: bash -l {0}
run: |
cd examples/des_y1_3x2pt
cosmosis des_y1_3x2pt.ini
- name: Running example - cosmosis - des-y1-3x2pt-PT
shell: bash -l {0}
run: |
cd examples/des_y1_3x2pt
cosmosis des_y1_3x2pt_PT.ini
- name: Running example - cobaya - des-y1-3x2pt
shell: bash -l {0}
run: |
cd examples/des_y1_3x2pt
cobaya-run cobaya_evaluate.yaml
- name: Running example - cobaya - des-y1-3x2pt-PT
shell: bash -l {0}
run: |
cd examples/des_y1_3x2pt
cobaya-run cobaya_evaluate_PT.yaml
- name: Running example - NumCosmo - des-y1-3x2pt
shell: bash -l {0}
run: |
cd examples/des_y1_3x2pt
python numcosmo_run.py
- name: Running example - NumCosmo - des-y1-3x2pt-PT
shell: bash -l {0}
run: |
cd examples/des_y1_3x2pt
python numcosmo_run_PT.py
- name: Running example - cosmosis - srd_sn
shell: bash -l {0}
run: |
cd examples/srd_sn
cosmosis sn_srd.ini
- name: Running example - NumCosmo - srd_sn
shell: bash -l {0}
run: |
cd examples/srd_sn
python numcosmo_run.py
- name: Running example - cosmosis - cluster_number_counts
shell: bash -l {0}
run: |
cd examples/cluster_number_counts
python generate_rich_mean_mass_sacc_data.py
cosmosis cluster_counts_redshift_richness.ini
cosmosis cluster_mean_mass_redshift_richness.ini
cosmosis cluster_counts_mean_mass_redshift_richness.ini
- name: Code coverage
if: ${{ (matrix.os == 'ubuntu') && (matrix.python-version == '3.11') }}
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python -m pip install --no-input coveralls
coverage run --source=firecrown -m pytest tests/
coveralls --service=github