Feat/add nasc fix #92
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
name: Test PR | |
on: | |
pull_request: | |
paths-ignore: ["**/docker.yaml", "docs"] | |
env: | |
CONDA_ENV: echopype | |
NUM_WORKERS: 2 | |
jobs: | |
test: | |
name: ${{ matrix.python-version }}--${{ matrix.runs-on }} | |
runs-on: ${{ matrix.runs-on }} | |
if: ${{ !contains(github.event.pull_request.title, '[skip ci]') }} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10"] # TODO: add back 3.11 once parsed2zarr is fixed | |
runs-on: [ubuntu-latest] | |
experimental: [false] | |
include: | |
- runs-on: ubuntu-latest | |
python-version: "3.11" | |
experimental: true | |
defaults: | |
run: | |
shell: bash -l {0} | |
services: | |
# TODO: figure out how to update tag when there's a new one | |
minio: | |
image: cormorack/minioci:latest | |
ports: | |
- 9000:9000 | |
httpserver: | |
image: cormorack/http:latest | |
ports: | |
- 8080:80 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags. | |
- name: Set environment variables | |
run: | | |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | |
- name: Setup micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: .ci_helpers/py${{ matrix.python-version }}.yaml | |
environment-name: ${{ env.CONDA_ENV }} | |
cache-environment: true | |
post-cleanup: 'all' | |
- name: Print conda environment | |
run: | | |
micromamba info | |
micromamba list | |
- name: Remove docker-compose python | |
if: ${{ matrix.python-version == '3.10' || matrix.python-version == '3.11' }} | |
run: sed -i "/docker-compose/d" requirements-dev.txt | |
- name: Install dev tools | |
run: | | |
micromamba install -c conda-forge -n ${{ env.CONDA_ENV }} --yes --file requirements-dev.txt | |
# We only want to install this on one run, because otherwise we'll have | |
# duplicate annotations. | |
- name: Install error reporter | |
if: ${{ matrix.python-version == '3.9' }} | |
run: | | |
python -m pip install pytest-github-actions-annotate-failures | |
- name: Install echopype | |
run: | | |
python -m pip install -e .[plot] | |
- name: Copying test data to services | |
run: | | |
python .ci_helpers/docker/setup-services.py --deploy --data-only --http-server ${{ job.services.httpserver.id }} | |
# Check data endpoint | |
curl http://localhost:8080/data/ | |
- name: Finding changed files | |
id: files | |
uses: Ana06/get-changed-files@v2.2.0 | |
with: | |
format: 'csv' | |
- name: Print Changed files | |
run: echo "${{ steps.files.outputs.added_modified_renamed }}" | |
- name: Running all Tests | |
if: contains(github.event.pull_request.title, '[all tests ci]') | |
run: | | |
pytest -vvv -rx --numprocesses=${{ env.NUM_WORKERS }} --max-worker-restart=3 --cov=echopype --cov-report=xml --log-cli-level=WARNING --disable-warnings | |
- name: Running Tests | |
if: ${{ !contains(github.event.pull_request.title, '[all tests ci]') }} | |
run: | | |
python .ci_helpers/run-test.py --pytest-args="--log-cli-level=WARNING,-vvv,-rx,--numprocesses=${{ env.NUM_WORKERS }},--max-worker-restart=3,--disable-warnings" --include-cov ${{ steps.files.outputs.added_modified_renamed }} | |
- name: Upload code coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
env_vars: RUNNER_OS,PYTHON_VERSION | |
name: codecov-umbrella | |
fail_ci_if_error: false |