-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (90 loc) · 2.45 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
name: build-test
on: [ pull_request ]
jobs:
validate-go-mod:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: setup env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- run: go mod tidy
test-tgapi:
runs-on: ubuntu-20.04
needs: validate-go-mod
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: setup env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- run: make -C tgapi test
test-tgrun:
runs-on: ubuntu-20.04
needs: validate-go-mod
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: setup env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- run: make -C tgrun test
build-web:
runs-on: ubuntu-20.04
needs: validate-go-mod
steps:
- uses: actions/setup-node@v4
with:
node-version: '14'
- uses: actions/checkout@v4
- run: make -C web deps build-staging
docker-image-tgapi:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: tgapi-build
run: |
docker build -f tgapi/deploy/Dockerfile \
--build-arg gitsha=${GITHUB_SHA:0:7} \
--build-arg buildtime="$(date --rfc-3339=seconds | sed 's/ /T/')" \
-t replicated/tgapi:${GITHUB_SHA:0:7} \
.
docker-image-tgrun:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: tgrun-build
run: |
docker build -f tgrun/Dockerfile \
--build-arg gitsha=${GITHUB_SHA:0:7} \
--build-arg buildtime="$(date --rfc-3339=seconds | sed 's/ /T/')" \
-t replicated/tgrun:latest \
-t replicated/tgrun:${GITHUB_SHA:0:7} \
.
build-test-success:
runs-on: ubuntu-latest
needs:
- validate-go-mod
- test-tgapi
- test-tgrun
- build-web
- docker-image-tgapi
- docker-image-tgrun
steps:
- run: echo "::notice ::build test success"