Skip to content

National Flood Hazard Layer #471

National Flood Hazard Layer

National Flood Hazard Layer #471

Workflow file for this run

name: CI
on:
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
REPO_NAME: ${{ github.event.repository.name }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: [3.8, '3.10']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set environment variables
run: |-
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ env.CONDA_ENV_FILE }}
environment-name: ${{ env.REPO_NAME }}-tests
create-args: >-
python=${{ env.PYTHON_VERSION }}
cache-environment: true
cache-environment-key: ${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}
- name: Install error reporter
if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.10'
run: |
python -m pip install pytest-github-actions-annotate-failures
- name: Install the package
run: |-
python -m pip install --no-deps .
- name: Version info
run: |-
NAME="$(echo ${REPO_NAME} | tr - _)"
python -c "import ${NAME}; ${NAME}.show_versions()"
- name: Run pytest
run: |-
pytest
# - name: Run typeguard
# run: |-
# micromamba install typeguard
# pytest --typeguard-packages=${REPO_NAME}
- name: Run codecov and upload the report
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
env_vars: RUNNER_OS,PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false