forked from zabbix-tools/go-zabbix
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (81 loc) · 2.3 KB
/
ci.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
89
90
91
92
93
94
95
96
97
name: "CI"
on:
push:
paths-ignore:
- "README.md"
- "LICENSE"
- ".editorconfig"
- ".gitignore"
pull_request:
jobs:
unittest:
timeout-minutes: 31
runs-on: ubuntu-latest
name: "Unit Tests"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Test Package
run: go test -v "./go-zabbix/.."
- name: Test Types Package
run: go test -v "./types/..."
integration:
timeout-minutes: 31
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
zabbix:
- version: "4.0"
suffix: "-latest"
postgress_version: "15-alpine"
- version: "5.0"
suffix: "-latest"
postgress_version: "15-alpine"
- version: "6.0"
suffix: "-latest"
postgress_version: "15-alpine"
- version: "6.2"
suffix: "-latest"
postgress_version: "15-alpine"
- version: "6.4"
suffix: "-latest"
postgress_version: "16-alpine"
- version: "7.0"
suffix: "-latest"
postgress_version: "16-alpine"
name: "Zabbix ${{ matrix.zabbix.version }} Integration Tests"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Start containers
run: docker compose -f "docker-compose.yml" up -d
env:
ZBX_VERSION: "${{ matrix.zabbix.version }}"
ZBX_VERSION_SUFFIX: "${{ matrix.zabbix.suffix }}"
POSTGRES_VERSION: "${{ matrix.zabbix.postgress_version }}"
- name: Wait for Zabbix server to become available
id: wait_for_server
uses: iFaxity/[email protected]
with:
resource: tcp:localhost:10051
timeout: 300000
interval: 10000
delay: 60000
log: true
- name: Server logs
if: always() && steps.wait_for_server.outcome == 'failure'
run: docker compose -f "docker-compose.yml" logs server
- name: Test
run: go test -v "./test/integration/..."
- name: Stop containers
if: always()
run: docker compose -f "docker-compose.yml" down --volumes