-
Notifications
You must be signed in to change notification settings - Fork 8
92 lines (77 loc) · 2.31 KB
/
on_master_commits.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
name: calculate coverage
on:
push:
branches:
- master
jobs:
# Calculates new coverage for the base branch
calc_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # need this so tags are pulled and versions work
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: 'latest'
python-version: "3.10"
activate-environment: test
environment-file: .github/test_conda_env.yml
condarc-file: .github/test_condarc.yml
- name: install obsplus
shell: bash -l {0}
run: |
pip install -e .[dev]
- name: download test data
shell: bash -l {0}
run: |
if [ ! -d ~/opsdata ]; then
git clone https://github.com/d-chambers/opsdata_test
mv opsdata_test ~/opsdata
fi
- name: run test suite
shell: bash -l {0}
run: |
pytest -s --cov obsplus --cov-report=xml
# upload coverage
- name: upload coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: PR_tests
fail_ci_if_error: false
update_gh_pages:
# Build new documentation for latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: 'latest'
python-version: "3.9"
activate-environment: test
environment-file: .github/test_conda_env.yml
condarc-file: .github/test_condarc.yml
- name: install obsplus
shell: bash -l {0}
run: |
pip install -e .[dev]
- name: git config
shell: bash -l {0}
run: |
git config --global user.email "[email protected]"
git config --global user.name "GithubActions"
- name: build docs
shell: bash -l {0}
run: |
python scripts/stage_docs.py --remove-dirty
- name: push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
directory: ../obsplus_documentation