Skip to content

Feature/add transient noise mask #1

Feature/add transient noise mask

Feature/add transient noise mask #1

Workflow file for this run

name: Test PR
on:
pull_request:
paths-ignore: ["**/docker.yaml", "docs"]
env:
CONDA_ENV: echopype
NUM_WORKERS: 2
jobs:
test:
name: ${{ matrix.python-version }}-build
runs-on: ubuntu-20.04
if: "!contains(github.event.pull_request.title, '[skip ci]')"
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- python-version: 3.8
experimental: false
- python-version: 3.9
experimental: false
- python-version: "3.10"
experimental: true
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@v3
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/provision-with-micromamba@v16
with:
environment-file: .ci_helpers/py${{ matrix.python-version }}.yaml
environment-name: ${{ env.CONDA_ENV }}
cache-env: true
cache-env-key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(format('.ci_helpers/py{0}.yaml', matrix.python-version)) }}
- name: Print conda env
shell: bash -l {0}
run: |
conda info
conda list
- name: Remove docker-compose python
if: ${{ matrix.python-version == '3.10' }}
shell: bash -l {0}
run: sed -i "/docker-compose/d" requirements-dev.txt
- name: Install dev tools
shell: bash -l {0}
run: |
micromamba install -c conda-forge -n ${{ env.CONDA_ENV }} --yes --file requirements-dev.txt
- name: Install echopype
shell: bash -l {0}
run: |
python -m pip install -e .[plot]
- name: Copying test data to services
shell: bash -l {0}
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: lsetiawan/get-changed-files@pr_target
with:
format: 'csv'
- name: Print Changed files
shell: bash -l {0}
run: echo "${{ steps.files.outputs.added_modified_renamed }}"
- name: Running all Tests
if: contains(github.event.pull_request.title, '[all tests ci]')
shell: bash -l {0}
run: |
pytest -vvv -rx --numprocesses=${{ env.NUM_WORKERS }} --max-worker-restart=3 --cov=echopype --cov-report=xml --log-cli-level=WARNING --disable-warnings |& tee ci_${{ matrix.python-version }}_test_log.log
- name: Running Tests
if: "!contains(github.event.pull_request.title, '[all tests ci]')"
shell: bash -l {0}
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 }} |& tee ci_test_log.log
- name: Upload ci test log
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v3
with:
name: ci_test_log
path: ci_test_log.log
- 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