CI #941
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: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" # Daily “At 00:00” | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
if: github.repository == 'carbonplan/ndpyramid' | |
name: ${{ matrix.python-version }}-build | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # This is required for requesting OIDC token for codecov | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
timeout-minutes: 20 | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Conda environment from environment.yml | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
# environment-file is not assumed anymore | |
environment-file: ci/environment.yml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
# now called cache-environment | |
cache-environment: true | |
- name: Install package | |
run: | | |
python -m pip install -e . --no-deps | |
- name: Conda list information | |
run: | | |
conda env list | |
conda list | |
- name: Run tests | |
run: | | |
python -m pytest --cov=./ --cov-report=xml --verbose | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.python-version }} == "3.11" | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.xml | |
fail_ci_if_error: false | |
use_oidc: true |