-
Notifications
You must be signed in to change notification settings - Fork 61
95 lines (80 loc) · 2.52 KB
/
main.yaml
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
# main test workflow; ported from .travis.yaml
name: main
on:
schedule:
- cron: '0 0 * * 5' # Runs on every Friday.
push:
branches: [ '*', $default-branch ]
tags: ['[0-9]*'] # anything looks like a version.
pull_request:
branches: [ $default-branch ]
jobs:
build:
runs-on: ${{ matrix.os }}
env:
OMP_NUM_THREADS: 1
defaults:
run:
shell: bash -l {0} # for conda.
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
numpy-version: [ '1.20' ]
python-version: [ 3.8 ]
include:
- {deploy: true, os: ubuntu-latest, numpy-version: '1.20', python-version: 3.8 }
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache.
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}
- name: Setup Conda Environment
uses: conda-incubator/[email protected]
with:
activate-environment: test
channels: bccp
show-channel-urls: true
use-only-tar-bz2: false
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Setup test env
run: |
conda install -q -y \
python=${{ matrix.python-version }} \
numpy=${{ matrix.numpy-version }} \
nose cython mpi4py \
--file requirements.txt \
--file requirements-extras.txt
# submitting coverage to coveralls
pip install coveralls
# install nbodykit itself
pip install .[extras]
conda list --explicit
- name: Install Compilers
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
conda install -q -y clang_osx-64 clangxx_osx-64 gfortran_osx-64
else
conda install -q -y gcc_linux-64 gxx_linux-64 gfortran_linux-64
fi
- name: Python Unit tests
run: |
python run-tests.py -v --mpirun='mpirun -n 4' --with-coverage
- name: Build Python sdist
if: startsWith(github.ref, 'refs/tags') && matrix.deploy
run: |
bash check_tag.sh "${GITHUB_REF##*/}" bigfile/version.py
python setup.py sdist
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
if: startsWith(github.ref, 'refs/tags') && matrix.deploy
with:
password: ${{ secrets.PYPI_SECRET }}