forked from TheThingsNetwork/lorawan-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (80 loc) · 2.04 KB
/
go-test.yml
File metadata and controls
83 lines (80 loc) · 2.04 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Go Code
on:
push:
paths:
- '**.go'
pull_request:
paths:
- '**.go'
jobs:
quality:
name: Code Quality
runs-on: ubuntu-18.04
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: '1.13'
- name: Check out code
uses: actions/checkout@v1
- name: Make Mage
run: make mage
- name: Check headers
run: ./mage headers:check
- name: Format Go code
run: ./mage go:fmt
- name: Fix common spelling mistakes
run: ./mage dev:misspell
- name: Remove unnecessary type conversions
run: ./mage go:unconvert
- name: Generate i18n messages
run: ./mage go:messages
- name: Check for diff
run: ./mage git:diff
test:
name: Tests
runs-on: ubuntu-18.04
services:
postgres:
image: postgres
ports:
- '5432/tcp'
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis
ports:
- '6379/tcp'
steps:
- name: Create ttn_lorawan_is_test DB
uses: docker://postgres
env:
PGPASSWORD: root
with:
entrypoint: /usr/bin/createdb
args: -h postgres -U root ttn_lorawan_is_test
- name: Create ttn_lorawan_is_store_test DB
uses: docker://postgres
env:
PGPASSWORD: root
with:
entrypoint: /usr/bin/createdb
args: -h postgres -U root ttn_lorawan_is_store_test
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: '1.13'
- name: Check out code
uses: actions/checkout@v1
- name: Make Mage
run: make mage
- name: mage go:test
env:
SQL_DB_ADDRESS: localhost:${{ job.services.postgres.ports['5432'] }}
SQL_DB_AUTH: 'root:root'
REDIS_ADDRESS: localhost:${{ job.services.redis.ports['6379'] }}
TEST_REDIS: '1'
TEST_SLOWDOWN: '8'
run: ./mage go:test