-
-
Notifications
You must be signed in to change notification settings - Fork 57
117 lines (98 loc) · 2.55 KB
/
Copy pathtest.yml
File metadata and controls
117 lines (98 loc) · 2.55 KB
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
109
110
111
112
113
114
115
116
117
name: Run tests
on:
push:
branches:
- '**'
tags-ignore:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
workflow_call:
jobs:
test:
name: Test, lint, format check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- name: Checkout
uses: actions/checkout@v6
with:
lfs: false
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true
- name: Install library
run: uv sync --all-extras --dev
- name: Run Ruff
run: uv run ruff check .
- name: Type check
run: uv run mypy src
- name: Format
run: >
uv run ruff format --diff
src
tests
- name: Unit tests
run: uv run pytest tests/unit
integration:
name: Integration tests
runs-on: ubuntu-latest
needs: test
strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
ros_version:
- "7.18.2"
- "6.33.3"
marks:
- "not asyncio"
- "asyncio"
steps:
- name: Checkout
uses: actions/checkout@v6
with:
lfs: false
fetch-depth: 0
fetch-tags: true
- name: Create docker image
run: docker create --name images lukaszkostka/librouteros_images:latest /dev/null
- name: Move vm images
run: docker cp images:/opt/routeros_${{ matrix.ros_version }}.qcow2 $GITHUB_WORKSPACE/images/
- name: Remove docker image
run: docker rm images
- name: Update apt
run: sudo apt-get update
- name: Install packages
run: >
sudo apt-get install -y --no-install-recommends --no-install-suggests
qemu-system-i386
qemu-utils
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true
- name: Install library
run: uv sync --all-extras --dev
- name: Integration tests
timeout-minutes: 10
run: uv run pytest tests/integration -k ${{ matrix.ros_version }} -m "${{ matrix.marks }}"