Cherry picking elliot's fork. #159
Workflow file for this run
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
# Continuous integration | |
name: CI | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
paths: | |
- "stac_mjx/**" | |
- "tests/**" | |
- ".github/workflows/ci.yml" | |
- "environment.yml" | |
push: | |
branches: | |
- main | |
paths: | |
- "stac_mjx/**" | |
- "tests/**" | |
- ".github/workflows/ci.yml" | |
- "environment.yml" | |
jobs: | |
# Lint with black and docstring check with pydocstyle | |
lint: | |
# This job runs: | |
# | |
# 1. Linting with black | |
# | |
# 2. Docstring style checking with pydocstyle | |
# Note: This uses Google-style docstring convention | |
# Ref: https://google.github.io/styleguide/pyguide.html | |
name: Lint | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
pip install --editable .[dev] | |
- name: Run Black | |
run: | | |
black --check stac_mjx tests | |
- name: Run pydocstyle | |
run: | | |
pydocstyle --convention=google stac_mjx/ | |
# Tests with pytest | |
tests: | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python: ["3.11"] | |
exclude: | |
- os: "macos-14" | |
python: "3.8" | |
name: Tests (${{ matrix.os }}, Python ${{ matrix.python }}) | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
conda-solver: "libmamba" | |
environment-file: environment.yml | |
activate-environment: stac-mjx-env | |
python-version: ${{ matrix.python }} | |
- name: Print environment info | |
shell: bash -l {0} | |
run: | | |
which python | |
conda info | |
conda list | |
pip freeze | |
- name: Test with pytest (with coverage) | |
shell: bash -l {0} | |
# Run pytest but ignore warnings from ndx_pose. If you need to add | |
# more warnings, please consider adding to pyproject.toml | |
run: | | |
pytest --cov=stac_mjx --cov-report=xml --durations=-1 -W ignore::PendingDeprecationWarning tests/ | |
- name: Upload coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
verbose: false | |
token: ${{ secrets.CODECOV_TOKEN }} |