-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (72 loc) · 2.15 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
name: "CI"
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
tests:
runs-on: ${{ matrix.OS }}-latest
name: "tests"
strategy:
fail-fast: false
matrix:
os: ['ubuntu',]
python-version:
- "3.9"
- "3.10"
- "3.11"
include:
- os: 'macos'
python-version: "3.11"
steps:
- uses: actions/checkout@v4
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: konnektor
cache-environment: true
cache-downloads: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=${{ matrix.python-version }}
- name: "Install"
run: pip install --no-deps -e .
- name: "Test imports"
run: |
# if we add more to this, consider changing to for + env vars
python -Ic "import konnektor"
- name: "Environment Information"
run: |
micromamba info
micromamba list
- name: "Run tests"
run: |
pytest -n auto -v --cov=konnektor --cov-report=xml --ignore=dev
- name: "Test Notebooks"
run: |
# another dep I don't want to include in the env
pip install --no-deps git+https://github.com/OpenFreeEnergy/kartograf.git
# Only need to test the notebook(s) in examples/
pytest -v --nbval-lax examples/
- name: codecov
if: ${{ github.repository == 'OpenFreeEnergy/konnektor' && github.event != 'schedule'}}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
env_vars: OS,PYTHON
fail_ci_if_error: True
verbose: True