generated from gwnrtools/gwnrtools
-
Notifications
You must be signed in to change notification settings - Fork 5
140 lines (132 loc) · 4.1 KB
/
python-test.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
# This workflow will setup and test the python code using miniconda
name: Setup test publish reports
on: [push, pull_request]
# Allows you to run this workflow manually from the Actions tab
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: nrcat
python-version: "3.10"
channels: main, conda-forge
allow-softlinks: true
channel-priority: flexible
show-channel-urls: true
- run: |
# Conda diagnostic
echo "Echoing conda diagnostic information"
conda --version
conda info
conda list
conda config --show-sources
conda config --show
conda info --envs
python --version
pip --version
pwd
ls -l
######################
# Setup linters
# conda install black isort -y
# ##################
# Setup nrcattools
echo "Setting up nrcatalogtools"
pip install -r requirements.txt
export NRC_DIR=${PWD}
echo $NRC_DIR
cd ./test
pwd
ls
echo "Downloading lalsuite-extras"
# ##################
# LAL extras
export LAL_DATA_PATH="${PWD}/lalsuite-extra/data/lalsimulation"
echo "Using LAL_DATA_PATH"
echo $LAL_DATA_PATH
mkdir -p $LAL_DATA_PATH
cd $LAL_DATA_PATH
ls
## lal extras fetch method
# git lfs pull
wget -q https://git.ligo.org/lscsoft/lalsuite-extra/-/raw/master/data/lalsimulation/SEOBNRv4ROM_v2.0.hdf5 -O SEOBNRv4ROM_v2.0.hdf5
cd $NRC_DIR
pwd
ls
pip install -r requirements.txt
ls
export WTOOLS_DIR=$PWD
echo $WTOOLS_DIR
export PYTHONPATH="$WTOOLS_DIR":$PYTHONPATH
echo $PYTHONPATH
####################
# Begin linting
# cd $NRC_DIR
# isort .
# black .
# flake8 .
# #################
# Begin testing
pip install coverage
echo "Begin testing"
cd $NRC_DIR/test
# python -m unittest -v
coverage run --source=../nrcatalogtools -m unittest discover -v
coverage html
python .generate_badge.py
- name: Upload logs
uses: actions/upload-artifact@v3
with:
name: logs_n_coverage
path: |
./test/logs/*
./test/cov_badge.svg
./test/htmlcov
cov_reports:
name: Publish coverage reports
needs: build
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artefacts from build
uses: actions/download-artifact@v3
with:
name: logs_n_coverage
- name: Diagnostics
run: |
ls
ls ../
mv cov_badge.svg htmlcov/
cd htmlcov
ls
pwd
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: '/home/runner/work/nr-catalog-tools/nr-catalog-tools/htmlcov'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2