Skip to content

Aadi/track local queues #92

Aadi/track local queues

Aadi/track local queues #92

Workflow file for this run

# Continuous integration
name: CI
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- "biogtr/**"
- "tests/**"
- ".github/workflows/ci.yml"
- "environment_cpu.yml"
- "pyproject.toml"
push:
branches:
- main
- talmo/updated-ci
paths:
- "biogtr/**"
- "tests/**"
- ".github/workflows/ci.yml"
- "environment_cpu.yml"
- "pyproject.toml"
defaults:
# This is needed for running steps within conda environments.
run:
shell: bash -l {0}
jobs:
# Lint with black, docstring check with pydocstyle, static type checking with mypy
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-22.04"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install --editable .[dev]
- name: Run Black
run: |
black --check biogtr tests
- name: Run pydocstyle
run: |
pydocstyle --convention=google biogtr/
# Tests with pytest
tests:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "windows-2022"]
python: [3.9]
name: Tests (${{ matrix.os }}, Python ${{ matrix.python }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Micromamba
# https://github.com/mamba-org/provision-with-micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment_cpu.yml
cache-env: true
channel-priority: flexible
- name: Print environment info
shell: bash -l {0}
run: |
which python
micromamba info
micromamba list
- name: Test with pytest
if: ${{ !(startsWith(matrix.os, 'ubuntu') && matrix.python == 3.9) }}
shell: bash -l {0}
run: |
pytest
- name: Test with pytest (with coverage)
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.python == 3.9 }}
shell: bash -l {0}
run: |
pytest --cov=biogtr --cov-report=xml tests/
- name: Upload coverage
uses: codecov/codecov-action@v3
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.python == 3.9 }}
with:
fail_ci_if_error: false
verbose: true