Skip to content

Reorganized tests

Reorganized tests #18

Workflow file for this run

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
run: go test -v -short "./..."
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 -run Integration "./..."
- name: Stop containers
if: always()
run: docker compose -f "docker-compose.yml" down --volumes