Skip to content

Compatibility fix for tests relating to building inventories using NR… #56

Compatibility fix for tests relating to building inventories using NR…

Compatibility fix for tests relating to building inventories using NR… #56

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