-
Notifications
You must be signed in to change notification settings - Fork 19
83 lines (73 loc) · 2.12 KB
/
boot-api.test.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: "orakl boot api test"
on:
push:
branches-ignore:
- "master"
paths:
- "node/pkg/boot/**"
- "node/migrations/boot/**"
workflow_dispatch:
jobs:
core-build:
strategy:
fail-fast: false
runs-on: ubuntu-latest
timeout-minutes: 10
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: orakl-test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.3"
check-latest: true
cache-dependency-path: |
./node/go.sum
- name: Run lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.54
working-directory: node/pkg/boot
skip-pkg-cache: true
skip-build-cache: true
args: --timeout=10m
- name: Run Vet
run: |
cd ./node/pkg/boot
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go vet ./...
go vet -vettool=$(which shadow) ./...
- name: Install golang-migrate
run: |
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.linux-amd64.tar.gz | tar xvz
sudo mv ./migrate /usr/bin
- name: Migrate up
run: |
cd ./node
migrate -database "postgresql://postgres:postgres@localhost:5432/orakl-test?search_path=public&sslmode=disable" -verbose -path ./migrations/boot up
- name: Install dependencies
run: |
cd ./node
go mod tidy
- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run test
run: |
cd ./node
task local:test-boot
env:
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/orakl-test?search_path=public"