-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (56 loc) · 1.88 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
name: CI
on:
pull_request:
paths-ignore:
- '.github/**' # Skip this workflow if the only change was inside the .github folder
workflow_call:
workflow_dispatch:
jobs:
# lint:
# runs-on: ubuntu-20.04
# continue-on-error: true
# steps:
# - uses: actions/checkout@v3
# - uses: ./.github/workflows/setupgo118amd64
# - 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
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setupgo118amd64
- name: Install dependencies
run: sudo apt-get update -y && sudo apt-get install -y gcc git-core gnupg build-essential
- name: Remove installed mongodb
run: sudo apt purge mongodb-org && sudo apt autoremove
- run: sudo snap install juju-db --channel 4.4/stable
- name: Pull candid repo for test environment
run: |
git clone https://github.com/canonical/candid.git ./tmp/candid
cd ./tmp/candid
DOCKER_BUILDKIT=1 \
docker build \
--cache-from candid:latest \
. -f ./Dockerfile -t candid
docker image ls candid
- name: Add volume files
run: |
touch ./local/vault/approle.json
touch ./local/vault/roleid.txt
- name: Start test environment
run: docker compose up -d
- name: Build and Test
run: go test -mod readonly ./...
env:
JIMM_DSN: postgresql://jimm:jimm@localhost:5432/jimm
PGHOST: localhost
PGPASSWORD: jimm
PGSSLMODE: disable
PGUSER: jimm
PGPORT: 5432