Skip to content

ci: use new pixi coverage task #254

ci: use new pixi coverage task

ci: use new pixi coverage task #254

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python on pull request
on:
pull_request:
paths:
- gravity_toolkit/**
- scripts/**
- test/**
- .github/workflows/python-request.yml
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 1 * *'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
OS: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up pixi environment
uses: prefix-dev/[email protected]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
pixi run lint
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
pixi run lint "--exit-zero --max-complexity=10 --max-line-length=127"
- name: Test with pytest
run: |
# install the package in editable mode
pixi run coverage "--username=${{ secrets.EARTHDATA_USERNAME }} --password=${{ secrets.EARTHDATA_PASSWORD }}"
- name: Create coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: coverage.xml
junitxml-path: pytest.xml
unique-id-for-comment: ${{ matrix.os }}
title: Coverage for Python on ${{ matrix.os }}
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.os }}
path: coverage.xml