forked from ava-labs/ortelius
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (54 loc) · 1.54 KB
/
ci.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: build-check
on:
push:
branches: [c4t, dev]
pull_request:
branches: [c4t, dev]
jobs:
lint:
name: lint
runs-on: ubuntu-22.04
strategy:
matrix:
go:
- '1.19'
steps:
- uses: actions/checkout@v3
- name: Submodules
run: git submodule update --init --recursive
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
args: --timeout 5m
test-and-build:
name: Test and build on Go ${{ matrix.go }}
runs-on: ubuntu-22.04
strategy:
matrix:
go:
- '1.19'
services:
mysql:
image: mysql:8.0.26
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: magellan_test
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v3
- name: Submodules
run: git submodule update --init --recursive
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Test binary build
run: go build cmds/magelland/magelland.go
- name: Migrate the database
run: |
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.11.0/migrate.linux-amd64.tar.gz | tar xvz
./migrate.linux-amd64 -path=services/db/migrations/ -database "mysql://root:password@tcp(127.0.0.1:3306)/magellan_test" up
- name: Run tests
run: make tests