tests #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |