This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
61 lines (60 loc) · 1.74 KB
/
tests.yaml
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
on: [push, pull_request]
name: Tests
jobs:
# Run unit and integration tests
tests:
services:
# Starts a mysql docker image so we can run vulndb integration tests
# against it.
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: vulndb
ports:
- 3306:3306
env:
MYSQL_TEST_DSN: root@/vulndb
defaults:
run:
working-directory: ${{ github.repository }}
strategy:
matrix:
go-version: [1.14.x, 1.15.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
with:
path: ${{ github.repository }}
- name: Download dependencies
run: go get -v -t -d ./...
- name: Unit Tests
run: go test -v ./...
# Run linters
golangci:
name: lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.repository }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
path: ${{ github.repository }}
- name: Download dependencies
run: go get -v -t -d ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# The version of golangci-lint is required and must be specified
# without patch version: we always use the latest patch version.
version: v1.52
working-directory: ${{ github.repository }}
args: "--disable-all -E revive -E gosimple -E govet -E ineffassign -E staticcheck -E structcheck -E varcheck -e SA5011: -e SA1019:"