[pre-commit.ci] pre-commit autoupdate (#1396) #324
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: build | |
on: | |
push: | |
branches: | |
- dev | |
- main | |
paths-ignore: ["**/docker.yaml"] | |
workflow_dispatch: | |
env: | |
NUM_WORKERS: 2 | |
jobs: | |
test: | |
name: ${{ matrix.python-version }}-build | |
runs-on: ubuntu-latest | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
runs-on: [ubuntu-latest] | |
experimental: [false] | |
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: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Remove docker-compose python | |
run: sed -i "/docker-compose/d" requirements-dev.txt | |
- name: Install dev tools | |
run: python -m pip install -r requirements-dev.txt | |
- name: Install echopype | |
run: python -m pip install -e ".[plot]" | |
- name: Print installed packages | |
run: python -m pip list | |
- 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: Running All Tests | |
shell: bash -l {0} | |
run: | | |
pytest -vv -rx --numprocesses=${{ env.NUM_WORKERS }} --max-worker-restart=3 --cov=echopype --cov-report=xml --log-cli-level=WARNING --disable-warnings | |
- name: Upload code coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
env_vars: RUNNER_OS,PYTHON_VERSION | |
name: codecov-umbrella | |
fail_ci_if_error: false |