-
Notifications
You must be signed in to change notification settings - Fork 47
96 lines (91 loc) · 2.65 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
name: CI/CD
on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
jobs:
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: 'pip'
- name: install requirements
run: |
python -m pip install -U pip
python -m pip install pre-commit tox
- name: run pre-commit
run: pre-commit run -a
- name: mypy and pip-audit (sdk)
run: |
cd compute_sdk
tox -e mypy
tox -e pip-audit
- name: mypy and pip-audit (endpoint)
run: |
cd compute_endpoint
tox -e mypy
tox -e pip-audit
# ensure docs can build, imitating the RTD build as best we can
check-docs:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: build docs
run: make docs
test-sdk:
timeout-minutes: 5
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
name: "Test SDK on py${{ matrix.python-version }} x ${{ matrix.os }} "
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install -U pip setuptools
- run: python -m pip install tox
- name: run tests
run: |
cd compute_sdk
tox -e py
test-endpoint:
timeout-minutes: 8
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq
ports:
- 5672:5672
# needed because the rabbitmq container does not provide a healthcheck
options: --health-cmd "rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_virtual_hosts && rabbitmq-diagnostics -q check_port_connectivity" --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
name: "Test Endpoint on py${{ matrix.python-version }} x ${{ matrix.os }} "
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install -U pip setuptools
- run: python -m pip install tox
- name: run tests
run: |
cd compute_endpoint
tox -e py -- --log-cli-level=ERROR
- name: Collect Docker Logs
if: failure()
uses: jwalton/[email protected]