-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (73 loc) · 2.07 KB
/
tests.yml
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
name: Tests
on:
workflow_call:
push:
branches:
- main
jobs:
integration-tests:
name: Integration tests ${{ matrix.python-version }}
runs-on: ubuntu-22.04
strategy:
matrix:
os: [ Ubuntu ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
include:
- os: Ubuntu
image: ubuntu-22.04
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build tests image
run: docker compose -f .ci/docker-compose.yml build --build-arg PYTHON_VERSION=${{ matrix.python-version }}
- name: Run integration tests
run: docker compose -f .ci/docker-compose.yml run xtdb_py_integration
unit-tests:
name: Unit tests ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.image }}
strategy:
matrix:
os: [ Ubuntu, macOS, Windows ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
include:
- os: Ubuntu
image: ubuntu-22.04
- os: Windows
image: windows-2022
- os: macOS
image: macos-12
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install requirements
run: poetry install --with dev
- name: Run unit tests
run: poetry run pytest
checks:
name: Check code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
id: py38
with:
python-version: 3.8
cache: pip
- name: Install pre-commit
run: pip install pre-commit
- name: Checks
run: pre-commit run --all --show-diff-on-failure --color always