Skip to content

CI

CI #2301

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # Daily “At 00:00”
workflow_dispatch:
jobs:
test:
# if: |
# github.repository == 'NCAR/geocat-comp'
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.9", "3.10", "3.11"]
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: checkout
uses: actions/checkout@v3
with:
token: ${{ github.token }}
- name: conda_setup
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: geocat_comp_build
channel-priority: strict
python-version: ${{ matrix.python-version }}
channels: conda-forge
environment-file: build_envs/environment.yml
- name: Install geocat-comp
run: |
python -m pip install --no-deps -e .
- name: conda list
run: |
conda list
- name: Run Tests
run: python -m pytest test -v
--cov=./geocat/comp
--cov-report=xml
--junitxml=pytest.xml
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: Test results for ${{ runner.os }}-${{ matrix.python-version }}
path: pytest.xml
- name: Upload code coverage to Codecov
uses: codecov/[email protected]
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
link-check:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: checkout
uses: actions/checkout@v3
with:
token: ${{ github.token }}
- name: conda_setup
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: gc-docs
channel-priority: strict
python-version: 3.9
channels: conda-forge
environment-file: build_envs/docs.yml
- name: Install geocat-comp
run: |
python -m pip install .
- name: check conda list
run: |
conda list
- name: Make docs with linkcheck
run: |
cd docs
make linkcheck