-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (78 loc) · 2.36 KB
/
core.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, push]
jobs:
ci-test:
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
poetry-version: ["1.4.2"]
os: [ubuntu-20.04, macos-latest, windows-latest]
project:
[
bia-shared-datamodels,
core,
]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ matrix.project }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: View poetry --help
run: poetry --help
- name: Poetry env setup
run: poetry env use python
- name: Poetry install
run: poetry install
- name: Check to see if poetry can build
run: poetry build
- name: Run pytest
run: poetry run pytest
ci-test-with-api:
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
poetry-version: ["1.4.2"]
# Note we do not test on windows or mac. Currently, github mac runners do not support nested virtualization, so we cannot run docker on them (since mac docker virtualises linux)
# See https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#limitations-for-arm64-macos-runners
os: [ubuntu-20.04]
project:
[
bia-export,
bia-ingest,
bia-assign-image,
]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ matrix.project }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run poetry image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Run docker
run: make -C ../ api.up
- name: set up poetry
run: |
poetry env use python
poetry install
- name: Run pytest
run: poetry run pytest
# Always cleanup - even for cancelled jobs
- name: Docker Compose Down
run: make -C ../ api.down
if: ${{ always() }}