Skip to content

tests

tests #36

Workflow file for this run

on:
push:
pull_request:
schedule:
- cron: '0 12 1 * *'
name: tests
jobs:
Test:
strategy:
fail-fast: false
matrix:
go-version:
- 1.14.x
- 1.15.x
- 1.16.x
- 1.17.x
- 1.x
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Start containers
run: |
mkdir -p testdata/docker/clamav/rootfs/var/lib/clamav
curl -L https://github.com/sergeymakinen/clamav_exporter/raw/fixtures/bytecode.cvd > testdata/docker/clamav/rootfs/var/lib/clamav/bytecode.cvd
curl -L https://github.com/sergeymakinen/clamav_exporter/raw/fixtures/daily.cvd > testdata/docker/clamav/rootfs/var/lib/clamav/daily.cvd
curl -L https://github.com/sergeymakinen/clamav_exporter/raw/fixtures/freshclam.dat > testdata/docker/clamav/rootfs/var/lib/clamav/freshclam.dat
for i in {1..10}; do
echo $i:
docker-compose -f testdata/docker/docker-compose.yml top | grep 'clamd' && sleep 10 && break || (docker-compose -f testdata/docker/docker-compose.yml up -d --force-recreate && sleep 30)
done
docker-compose -f testdata/docker/docker-compose.yml top
- name: Test
run: go test -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2