-
Notifications
You must be signed in to change notification settings - Fork 76
87 lines (83 loc) · 3.21 KB
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Test PR
on:
pull_request:
paths-ignore: ["**/docker.yaml", "docs"]
env:
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", "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 up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Set environment variables
run: |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- 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
# 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: Print installed packages
run: python -m pip list
- 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/[email protected]
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@v5
with:
file: ./coverage.xml
flags: unittests
env_vars: RUNNER_OS,PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false