-
Notifications
You must be signed in to change notification settings - Fork 77
108 lines (104 loc) · 3.34 KB
/
ci.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: build
on:
push:
branches:
- dev
- main
paths-ignore: [".ci_helpers/docker/**", "**/docker.yaml"]
workflow_dispatch:
env:
CONDA_ENV: echopype
jobs:
test:
name: ${{ matrix.python-version }}-build
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8]
experimental: [false]
include:
- python-version: 3.9
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@v2
- name: Copying test data to http server
run: |
rm -rf ./echopype/test_data
docker cp -L ${{ job.services.httpserver.id }}:/usr/local/apache2/htdocs/data ./echopype/test_data
# Check data endpoint
curl http://localhost:8080/data/
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Set environment variables
run: |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if '.ci_helpers/py{0}.yaml' has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(format('.ci_helpers/py{0}.yaml', matrix.python-version)) }}
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ${{ env.CONDA_ENV }}
environment-file: .ci_helpers/py${{ matrix.python-version }}.yaml
miniforge-variant: Mambaforge
miniforge-version: 4.11.0-0
use-mamba: true
auto-activate-base: false
use-only-tar-bz2: true
- name: Update mamba
shell: bash -l {0}
run: |
conda update -c conda-forge --yes mamba
- name: Print conda env
shell: bash -l {0}
run: |
conda info
conda list
- name: Install dev tools
shell: bash -l {0}
run: |
mamba install -c conda-forge --yes --file requirements-dev.txt
- name: Install echopype
shell: bash -l {0}
run: |
python -m pip install -e .
- name: Running All Tests
shell: bash -l {0}
run: |
pytest -vv -rx --cov=echopype --cov-report=xml --log-cli-level=WARNING --disable-warnings |& tee ci_${{ matrix.python-version }}_test_log.log
- name: Upload ci test log
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v2
with:
name: ci_test_log
path: ci_test_log.log
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
env_vars: RUNNER_OS,PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false