-
Notifications
You must be signed in to change notification settings - Fork 55
52 lines (42 loc) · 1.08 KB
/
default.yml
File metadata and controls
52 lines (42 loc) · 1.08 KB
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
name: Linter & Tests
on:
push:
branches:
- '**'
- '!main'
- '!develop'
pull_request:
branches:
- '**'
- '!main'
- '!develop'
env:
TEST_CONTAINER_NAME: "test_db"
TEST_DB_NAME: "test"
TEST_DB_URI: "mongodb://localhost:27019"
jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.41
tests:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Checkout code
uses: actions/checkout@v2
- name: Unit Tests
run: go test --short ./...
- name: Create test db container
run: docker run --rm -d -p 27019:27017 --name $(echo $TEST_CONTAINER_NAME) -e MONGODB_DATABASE=$(echo $TEST_DB_NAME) mongo:4.4-bionic
- name: Integration Tests
run: GIN_MODE=release go test -v ./tests/
- name: Kill test db container
run: docker stop $(echo $TEST_CONTAINER_NAME)