-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (42 loc) · 1.55 KB
/
tests.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
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