-
Notifications
You must be signed in to change notification settings - Fork 293
72 lines (62 loc) · 2.24 KB
/
run_tests.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
name: tests
# We run the test suite on every push
on: [push, pull_request]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Note that miniconda is installed by default in environments
- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: datascience
environment-file: linux_environment.yml
python-version: '3.10'
auto-activate-base: true
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
export PATH="$CONDA/bin:$PATH"
conda init bash
- name: Setup python requirements
run: |
source activate datascience
python -m pip install --upgrade pip
python -m pip --version
python -m pip install -r requirements.txt
python -m pip install -r docs/requirements.txt
python -m pip install -r requirements-tests.txt
python setup.py develop
- name: Run Tests
run: |
source activate datascience
make test
- name: Upload coverage data to Coveralls
run: |
source activate datascience
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push docs
if: github.ref_name == 'master' && github.event_name == 'push'
run: |
source activate datascience
python -m pip install -r docs/requirements.txt
python -m pip uninstall pandoc
conda install pandoc
git config --global user.name github-actions
git config --global user.email [email protected]
echo "-- building docs --"
make docs
echo "-- pushing docs --"
rm -rf doc_build
git clone --quiet --branch=gh-pages $GITHUB_SERVER_URL/$GITHUB_REPOSITORY doc_build
cp -r docs/_build/html/* doc_build
cd doc_build
git add -A
git commit -m "Generated by commit $GITHUB_SHA, pushed by GitHub run $GITHUB_RUN_ID."
echo "-- try to push --"
git push "https://${{github.actor}}:${{github.token}}@github.com/${{github.repository}}.git"
rm -rf doc_build