Skip to content

ci: use pixi for builds #247

ci: use pixi for builds

ci: use pixi for builds #247

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
pip install --no-deps --editable .
pixi run --environment dev pytest -n 0 --cov=./ --cov-report=xml \
--username=${{ secrets.EARTHDATA_USERNAME }} \
--password=${{ secrets.EARTHDATA_PASSWORD }}
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.os }}
path: ./coverage.xml