CI #1133
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: "0 0 * * *" # Daily “At 00:00” | |
workflow_dispatch: # allows you to trigger manually | |
jobs: | |
skip-duplicate-jobs: | |
runs-on: ubuntu-latest | |
if: | | |
github.repository == 'ncar-xdev/python-project-template' | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/[email protected] | |
with: | |
# For workflows which are triggered concurrently with the same | |
# contents, attempt to execute them exactly once. | |
concurrent_skipping: "same_content_newer" | |
paths_ignore: '["**/doc/**"]' | |
build: | |
name: python-${{ matrix.python-version }} | |
needs: skip-duplicate-jobs | |
if: ${{ needs.skip-duplicate-jobs.outputs.should_skip != 'true' }} | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
channels: conda-forge,nodefaults | |
channel-priority: strict | |
activate-environment: xdev-project-dev | |
auto-update-conda: false | |
python-version: ${{ matrix.python-version }} | |
environment-file: ci/environment.yml | |
mamba-version: "*" | |
use-mamba: true | |
miniforge-variant: Mambaforge | |
- name: Install xdev-project | |
run: | | |
python -m pip install -e . --no-deps --force-reinstall | |
conda list | |
- name: Run Tests | |
run: | | |
python -m pytest | |
- 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 |