Skip to content

Update github actions #470

Update github actions

Update github actions #470

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 package
on:
push:
branches: ['**']
pull_request:
branches: ['main']
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
- name: Debug checkout ref
run: |
echo "event_name=${{ github.event_name }}"
echo "github_ref=${{ github.ref }}"
echo "github_sha=${{ github.sha }}"
echo "pr_head_sha=${{ github.event.pull_request.head.sha }}"
git rev-parse HEAD
- name: Set up Python 3.14
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.14'
cache: pip
cache-dependency-path: pyproject.toml
- name: Install Ruff
run: python -m pip install --upgrade pip ruff
- name: Ruff check
run: ruff check .
- name: Ruff format check
run: ruff format --check .
build:
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.9, 3.13, 3.14]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test,nldi]
- name: Test with pytest and report coverage
run: |
coverage run -m pytest tests/
coverage report -m