-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (55 loc) · 2.46 KB
/
Copy pathpython-test-package.yml
File metadata and controls
61 lines (55 loc) · 2.46 KB
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
# Continuous integration
name: Test the Python Package
on:
pull_request: {}
workflow_dispatch:
push:
branches: [ main ]
permissions:
contents: read
jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
gammapy-version: ["1.1", "1.2", "1.3", "2.0", "2.1"]
python-version: ["3.9", "3.11", "3.12", "3.13"]
exclude:
- gammapy-version: 1.1
python-version: 3.11
- gammapy-version: 1.2
python-version: 3.9
- gammapy-version: 1.3
python-version: 3.9
- gammapy-version: 1.1
python-version: 3.13
- gammapy-version: 1.1
python-version: 3.12
- gammapy-version: 1.2
python-version: 3.13
- gammapy-version: 2.0
python-version: 3.9
- gammapy-version: 2.1
python-version: 3.9
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies, download test data, install package and run test
run: |
python -m pip install --upgrade pip wheel pytest
if [ "${{ matrix.gammapy-version }}" = "1.1" ]; then python -m pip install "setuptools<82" astropy==5.3.4 numpy==1.22 scipy==1.8; elif [ "${{ matrix.gammapy-version }}" = "1.2" ]; then python -m pip install --upgrade setuptools && python -m pip install astropy==6.1.7 matplotlib==3.8; else python -m pip install --upgrade setuptools && echo "No specific version of astropy and numpy required"; fi
python -m pip install gammapy==${{ matrix.gammapy-version }}
git clone --depth 1 --branch v${{ matrix.gammapy-version }} https://github.com/gammapy/gammapy-data
export GAMMAPY_DATA=$PWD/gammapy-data/
python -m pip install .
python -c "import sys; print(\"Python version : \", sys.version)"
python -c "import gammapy; print(\"gammapy version : \", gammapy.__version__)"
python -c "import astropy; print(\"astropy version : \", astropy.__version__)"
python -c "import numpy; print(\"numpy version : \", numpy.__version__)"
python -c "import scipy; print(\"scipy version : \", scipy.__version__)"
python -c "import iminuit; print(\"iminuit version : \", iminuit.__version__)"
python -c "import regions; print(\"regions version : \", regions.__version__)"
pytest