Repository navigation
71 lines (59 loc) · 1.5 KB
/
Copy pathci.yml
File metadata and controls
71 lines (59 loc) · 1.5 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
---
name: CI
"on":
push:
branches:
- "*"
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/ruff-action@v3
- uses: astral-sh/ruff-action@v3
with:
args: format --check
test:
strategy:
matrix:
include:
- netbox: v4.0
- netbox: v4.1
- netbox: v4.2
- netbox: v4.3
- netbox: v4.4
- netbox: v4.5
- netbox: v4.6
- netbox: v4.7
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Run uv build
run: uv build
- name: Build the Docker image
env:
CONTAINER_TAG: ${{ matrix.netbox }}
run: |
WHL_FILE=$(ls ./dist/ | grep .whl)
cp "./dist/$WHL_FILE" ./tests/docker/
cd ./tests/docker/
docker compose build --build-arg "FROM=netboxcommunity/netbox:$CONTAINER_TAG" --build-arg "WHL_FILE=$WHL_FILE"
- name: Start netbox
working-directory: ./tests/docker/
run: docker compose up -d
- name: Run pytest
run: |
uv run pytest -v
- name: Show Docker logs
if: ${{ always() }}
working-directory: ./tests/docker/
run: docker compose logs