131 lines (114 loc) · 2.89 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build/Test
on:
push:
branches:
- develop
pull_request:
branches:
- develop
jobs:
validate-protobuf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: ./
-
name: Install Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
-
name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: '25.3'
-
name: Install just
uses: extractions/setup-just@v1
- name: install protobuf-go
run: |
go install github.com/golang/protobuf/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
which protoc-gen-go-grpc
-
name: Validate
run: |
just validate-protobuf
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: ./
-
name: Install just
uses: extractions/setup-just@v1
-
name: Install Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
# Saves us from having to redownload all modules
- name: Go Mod cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
-
name: Test
run: |
just test
-
name: Build
run: |
just build-local
- name: get-pr-info
shell: bash
env:
PR_NUM: ${{ github.event.number }}
run: |
echo $PR_NUM > pr_num.txt
echo $GITHUB_BASE_REF > base.txt
echo $GITHUB_HEAD_REF > head.txt
- name: Upload code coverage
uses: actions/upload-artifact@v4
with:
name: oc-code-coverage
path: |
coverage.out
pr_num.txt
base.txt
head.txt
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: ./
-
name: Install just
uses: extractions/setup-just@v1
-
name: Install node
uses: actions/setup-node@v4
with:
node-version: '18.3.0'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('./ui/**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Build
working-directory: ./ui
run: |
just build-local