-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (62 loc) · 1.81 KB
/
ci.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
name: CI
on:
push:
pull_request:
workflow_dispatch:
env:
GH_AUTH: ${{ secrets.GH_AUTH }}
GH_USER: ${{ secrets.GH_USER }}
jobs:
lint:
runs-on: ubuntu-20.04
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setupgo118amd64
with:
user: ${{ secrets.GH_USER }}
pat: ${{ secrets.GH_AUTH }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
skip-pkg-cache: true
skip-build-cache: true
build_test:
name: Build and Test
# needs:
# - lint
runs-on: ubuntu-20.04
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get update -y && sudo apt-get install -y gcc git-core gnupg
- name: Remove installed mongodb
run: sudo apt purge mongodb-org && sudo apt autoremove
- run: sudo snap install juju-db
- name: Install vault
run: sudo snap install vault --classic
- uses: ./.github/workflows/setupgo118amd64
- name: Build and Test
run: go test -mod readonly ./...
env:
JIMM_DSN: postgresql://postgres:password@localhost:5432/jimm
PGHOST: localhost
PGPASSWORD: password
PGSSLMODE: disable
PGUSER: postgres
PGPORT: 5432