Adding template manager file #25
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
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: lint and style checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install black black[jupyter] ruff | |
- name: Black style check | |
run: | | |
black --check . | |
- name: Lint with ruff | |
run: | | |
ruff check . | |
build_0: | |
name: raw2zarr unit tests - linux | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
CONDA_ENV_FILE: environment.yml | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ "3.12" ] | |
numpy-version: [ "1", "2" ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install micromamba environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-name: raw2zarr-unit-tests | |
environment-file: ${{env.CONDA_ENV_FILE}} | |
cache-environment: true | |
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" | |
create-args: >- | |
python=${{matrix.python-version}} | |
numpy=${{matrix.numpy-version}} | |
conda | |
- name: Install raw2zarr | |
run: | | |
python -m pip install . --no-deps | |
- name: Install Test Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest pytest-xdist pytest-cov | |
- name: Version Info | |
run: | | |
python -c "import raw2zarr; print(raw2zarr.__version__)" | |
- name: Test with pytest | |
run: | | |
pytest -n auto --dist loadfile --verbose --durations=15 --cov-report xml:coverage_unit.xml --cov=raw2zarr --cov-append | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage_unit.xml | |
flags: unittests | |
env_vars: RUNNER_OS,PYTHON_VERSION | |
name: codecov-gha | |
fail_ci_if_error: false | |
token: ${{ secrets.CODECOV_TOKEN}} |