forked from gammapy/gammapy
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (170 loc) · 5.18 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
164
165
166
167
168
169
170
171
172
173
174
175
name: CI
on: [push, pull_request]
jobs:
pyflakes:
name: pyflakes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install pyflakes
run: python -m pip install pyflakes
- name: Run pyflakes
run: pyflakes gammapy
basic:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
PYTEST_ADDOPTS: --color=yes -n auto --dist=loadscope
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false # true
matrix:
include:
- name: Linux python 3.8 all-deps
os: ubuntu-latest
- name: Linux python 3.8 core-deps
os: ubuntu-latest
- name: Linux python 3.9 core-deps
os: ubuntu-latest
- name: Linux python 3.10 core-deps
os: ubuntu-latest
- name: Windows python 3.8 core-deps
os: windows-latest
python: 3.8
- name: Mac python 3.8 core-deps
os: macos-latest
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: install python3.9
if: contains(matrix.name, '3.9')
run: |
sed -itmp 's/python=3.8/python=3.9/' environment-dev.yml
- name: install python3.10
if: contains(matrix.name, '3.10')
run: |
sed -itmp 's/python=3.8/python=3.10/' environment-dev.yml
- name: add core dependencies env file
if: contains(matrix.name, 'core-deps')
run: |
awk '{f="env" NR; print $0> f}' RS='# extra dependencies' environment-dev.yml
mv env1 environment-dev.yml
cat environment-dev.yml
- name: install dependencies with pip
if: matrix.name=='Windows python 3.8 core-deps'
run: |
pip install astropy click cython numpy pydantic pyyaml regions scipy
pip install pytest pytest-astropy requests tqdm pytest-xdist
- name: create and activate env
if: matrix.name!='Windows python 3.8 core-deps'
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment-dev.yml
- name: install gammapy
run: |
pip install -e .
- name: test coverage
if: contains(matrix.name, 'all-deps')
run: |
gammapy download datasets
export GAMMAPY_DATA=./gammapy-datasets
make test-cov
codecov -X gcov
- name: test simple
if: contains(matrix.name, 'core-deps')
run: |
make test
sphinx:
name: Linux python 3.8 sphinx all-deps
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
PYTEST_ADDOPTS: --color=yes -n auto --dist=loadscope
GAMMAPY_DATA: /home/runner/work/gammapy/gammapy/gammapy-datasets
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: create and activate env
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment-dev.yml
- name: install gammapy
run: |
pip install -e .
- name: download datasets
run: |
gammapy download datasets
- name: test build docs
run: |
make docs-sphinx
- name: test code in docs and docstrings
run: |
pytest --doctest-glob="*.rst" --ignore-glob=docs/development/pigs/*.rst docs/
pytest --doctest-modules --ignore-glob=*/tests gammapy
- name: test without datasets
run: |
unset GAMMAPY_DATA
make test
conda-build:
name: Linux python 3.8 conda-build all-deps
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: create and activate env
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment-dev.yml
- name: install gammapy
run: |
pip install -e .
- name: test conda build
run: |
make clean
conda install conda-build
conda info
conda --version
conda build --version
python setup.py bdist_conda
oldest:
name: Linux python 3.8 old-versions core
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
PYTEST_ADDOPTS: --color=yes
GAMMAPY_DATA: /home/runner/work/gammapy/gammapy/gammapy-datasets
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: create and activate env
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
mamba-version: "*"
channels: conda-forge, defaults
channel-priority: true
- name: install dependencies
run: |
mamba install click=7.0 pydantic=1.4 pyyaml=5.1 regions=0.5 scipy=1.4 astropy=5.0 numpy=1.19 tqdm requests
- name: install gammapy
run: |
pip install -e .
- name: download datasets
run: |
gammapy download datasets
- name: test simple
run: |
gammapy info
make test