-
Notifications
You must be signed in to change notification settings - Fork 26
131 lines (114 loc) · 3.34 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
name: continuous-integration
on:
push:
branches:
- main
- master
- releases/*
pull_request: null
env:
CACHE_NUMBER: 0 # increase to reset cache manually
CONDA_ENV: .github/environment.yml
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
include:
- os: macos-latest
label: osx-64
prefix: /Users/runner/miniconda3
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3
py:
- 3.11
CC:
- gcc
steps:
#- name: Cancel previous runs
# uses: styfle/[email protected]
# with:
# access_token: ${{ github.token }}
- name: Checkout NaMaster repository
uses: actions/checkout@v4
- name: Set up conda
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge, defaults
channel-priority: strict
show-channel-urls: true
miniforge-version: latest
miniforge-variant: Mambaforge
#- name: Set up Python ${{ matrix.py }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.py }}
#- name: Install GSL, FFTW, fitsio
# run: |
# sudo -H apt-get install libgsl-dev libfftw3-dev libcfitsio-dev
#- name: Install python dependencies
# run: |
# python -m pip install -U pip
# pip install -U numpy
# pip install -U scipy
# pip install -U healpy
# pip install -U ducc0
# pip install -U flake8
# pip install -U pytest
# pip install -U pytest-cov
# pip install -U coveralls
- name: Set current date as environment variable
run: echo "TODAY=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
- name: Get cached environment
uses: actions/cache@v3
id: cache
with:
path: ${{ matrix.prefix }}
key:
conda-py${{ matrix.py }}--${{
matrix.os }}--${{
hashFiles(env.CONDA_ENV) }}-${{
hashFiles('setup.py') }}--${{
env.TODAY }}-${{
env.CACHE_NUMBER }}
- name: Install environment packages
if: steps.cache.outputs.cache-hit != 'true'
run: |
export MAMBA_NO_BANNER=1 # hide mamba banner from output
mamba env update --file ${{ env.CONDA_ENV }} --prune
conda activate test
#- name: Flake
# run: |
# flake8 pymaster --exclude=nmtlib.py
# flake8 test --exclude=benchmarks
- name: Build NaMaster
run: |
python setup.py install
- name: C tests
run: |
make check
- name: Python tests
run: |
pytest -vv pymaster --cov=pymaster
# - name: Clean install with threads
# run: |
# pip uninstall pymaster -y
# rm _deps/lib/libnmt.a
# python setup.py install --enable-fftw-pthreads --disable-openmp
#
# - name: C tests with threads
# run: |
# make check
#
# - name: Python tests with threads
# run: |
# pytest -vv pymaster
#
- name: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github