forked from authzed/spicedb-operator
-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (86 loc) · 2.29 KB
/
build-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
84
85
86
87
88
---
name: "Build & Test"
on: # yamllint disable-line rule:truthy
push:
branches:
- "main"
paths:
- ".github/workflows/build-test.yaml"
- "Dockerfile"
- "go.mod"
- "go.sum"
- "cmd/**"
- "pkg/**"
- "e2e/**"
- "internal/**"
pull_request:
branches:
- "*"
paths:
- ".github/workflows/build-test.yaml"
- "Dockerfile"
- "go.mod"
- "go.sum"
- "cmd/**"
- "pkg/**"
- "e2e/**"
- "internal/**"
jobs:
build:
name: "Build Binary"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-go@v3"
with:
go-version: "~1.19"
- uses: "authzed/actions/go-build@main"
image-build:
name: "Build Container Image"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-go@v3"
with:
go-version: "~1.19"
- uses: "authzed/actions/docker-build@main"
with:
push: false
tags: "authzed/spicedb-operator:ci"
buildx: false
qemu: false
test:
name: "Test"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
with:
submodules: true
- uses: "actions/setup-go@v2"
with:
go-version: "^1.19"
- uses: "actions/checkout@v3"
with:
repository: "authzed/spicedb"
path: "spicedb"
submodules: true
- uses: "docker/setup-qemu-action@v2"
- uses: "docker/setup-buildx-action@v2"
- name: "Tag Test SpiceDB Image"
uses: "docker/build-push-action@v3"
with:
context: "spicedb"
file: "spicedb/Dockerfile"
tags: "spicedb:dev,spicedb:updated"
outputs: "type=docker,dest=/tmp/image.tar"
- name: "Run Ginkgo Tests"
run: "go run github.com/onsi/ginkgo/v2/ginkgo --skip-package ./spicedb --tags=e2e -r --procs=2 -v --randomize-all --randomize-suites --fail-on-pending --race --trace --json-report=report.json -- -v=4"
env:
PROVISION: "true"
ARCHIVES: "/tmp/image.tar"
- uses: "docker/build-push-action@v2"
with:
context: "./"
file: "./Dockerfile"
push: false
tags: "spicedb-operator:dev"