Skip to content

Commit 59410c7

Browse files
mandyschenMandy Chen
andauthored
Migrate from buildkite to github actions (#1443)
* Migrate from buildkite to github actions * Fix paths in yaml file * Added debugging * Remove debugging * change path * More specific artifact path * Include hidden files * Add include hidden files everywhere --------- Co-authored-by: Mandy Chen <[email protected]>
1 parent 2af19f2 commit 59410c7

File tree

11 files changed

+439
-0
lines changed

11 files changed

+439
-0
lines changed

.buildkite/pipeline.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,5 @@ steps:
133133
- docker-compose#v3.0.0:
134134
run: integ-test-grpc
135135
config: docker/buildkite/docker-compose.yml
136+
137+
# TODO: delete this file after migration to github actions

.buildkite/scripts/fossa.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ EXIT_STATUS=$?
1111

1212
echo "fossa script exits with status $EXIT_STATUS"
1313
exit $EXIT_STATUS
14+
15+
# TODO: delete this file after migration to github actions

.buildkite/scripts/gen_coverage_metadata.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ echo "commit-sha: $BUILDKITE_COMMIT" > "$output_path"
2929
echo "timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$output_path"
3030

3131
echo "Coverage metadata written to $output_path"
32+
33+
# TODO: delete this file after migration to github actions

.github/workflows/ci-checks.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: CI Checks
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
golang-unit-test:
8+
name: Golang unit test
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
submodules: true
16+
fetch-depth: 0 # get full history for branch checking
17+
18+
- name: Setup Go environment
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.23.4'
22+
23+
- name: Run unit test
24+
run: docker compose -f docker/github_actions/docker-compose.yml run unit-test bash -c "make unit_test && ./scripts/gen_coverage_metadata.sh .build/metadata.txt"
25+
26+
- name: Upload coverage artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: go-unit-test-coverage
30+
path: |
31+
.build/*/coverage/*.out
32+
.build/cover.out
33+
.build/metadata.txt
34+
include-hidden-files: true
35+
36+
golangci-lint-validate-code-is-clean:
37+
name: Golangci lint validate code is clean
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
with:
44+
submodules: true
45+
fetch-depth: 0 # get full history for branch checking
46+
47+
- name: Setup Go environment
48+
uses: actions/setup-go@v5
49+
with:
50+
go-version: '1.23.4'
51+
52+
- name: Run golint
53+
run: docker compose -f docker/github_actions/docker-compose.yml run unit-test bash -c "./scripts/golint.sh"
54+
55+
golang-integration-test-sticky-off:
56+
name: Golang integration test sticky off
57+
runs-on: ubuntu-latest
58+
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
with:
63+
submodules: true
64+
fetch-depth: 0 # get full history for branch checking
65+
66+
- name: Setup Go environment
67+
uses: actions/setup-go@v5
68+
with:
69+
go-version: '1.23.4'
70+
71+
- name: Run integration test sticky off
72+
uses: nick-fields/retry@v3
73+
with:
74+
max_attempts: 2
75+
timeout_minutes: 30
76+
command: |
77+
docker compose -f docker/github_actions/docker-compose.yml run integ-test bash -c "make integ_test_sticky_off"
78+
79+
- name: Upload coverage artifacts
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: go-integration-sticky-off-coverage
83+
path: .build/*/coverage/*.out
84+
include-hidden-files: true
85+
86+
golang-integration-test-sticky-on:
87+
name: Golang integration test sticky on
88+
runs-on: ubuntu-latest
89+
90+
steps:
91+
- name: Checkout
92+
uses: actions/checkout@v4
93+
with:
94+
submodules: true
95+
fetch-depth: 0 # get full history for branch checking
96+
97+
- name: Setup Go environment
98+
uses: actions/setup-go@v5
99+
with:
100+
go-version: '1.23.4'
101+
102+
- name: Run integration test sticky on
103+
uses: nick-fields/retry@v3
104+
with:
105+
max_attempts: 2
106+
timeout_minutes: 30
107+
command: |
108+
docker compose -f docker/github_actions/docker-compose.yml run integ-test bash -c "make integ_test_sticky_on"
109+
110+
- name: Upload coverage artifacts
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: go-integration-sticky-on-coverage
114+
path: .build/*/coverage/*.out
115+
include-hidden-files: true
116+
117+
golang-integration-test-grpc:
118+
name: Golang integration test gRPC adapter
119+
runs-on: ubuntu-latest
120+
121+
steps:
122+
- name: Checkout
123+
uses: actions/checkout@v4
124+
with:
125+
submodules: true
126+
fetch-depth: 0 # get full history for branch checking
127+
128+
- name: Setup Go environment
129+
uses: actions/setup-go@v5
130+
with:
131+
go-version: '1.23.4'
132+
133+
- name: Run integration test gRPC
134+
uses: nick-fields/retry@v3
135+
with:
136+
max_attempts: 2
137+
timeout_minutes: 30
138+
command: |
139+
docker compose -f docker/github_actions/docker-compose.yml run integ-test-grpc bash -c "make integ_test_grpc"
140+
141+
- name: Upload coverage artifacts
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: go-integration-grpc-coverage
145+
path: .build/*/coverage/*.out
146+
include-hidden-files: true
147+

docker/buildkite/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ RUN echo \
1818
"deb [signed-by=/usr/share/keyrings/buildkite-agent-archive-keyring.gpg] https://apt.buildkite.com/buildkite-agent stable main" | \
1919
tee /etc/apt/sources.list.d/buildkite-agent.list
2020
RUN apt-get update && apt-get install -yy --no-install-recommends buildkite-agent
21+
22+
# TODO: delete this file after migration to github actions

docker/buildkite/docker-compose-local.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,5 @@ networks:
147147
services-network:
148148
name: services-network
149149
driver: bridge
150+
151+
# TODO: delete this file after migration to github actions

docker/buildkite/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,5 @@ networks:
120120
services-network:
121121
name: services-network
122122
driver: bridge
123+
124+
# TODO: delete this file after migration to github actions

docker/github_actions/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM golang:1.24
2+
3+
RUN mkdir -p /go/src/go.uber.org/cadence
4+
WORKDIR /go/src/go.uber.org/cadence
5+
6+
ADD go.mod go.sum /go/src/go.uber.org/cadence/
7+
8+
# allow git-status and similar to work
9+
RUN git config --global --add safe.directory /go/src/go.uber.org/cadence
10+
RUN GO111MODULE=on go mod download
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
version: "3.5"
2+
3+
services:
4+
cassandra:
5+
image: cassandra:4.1.3
6+
ports:
7+
- "9042:9042"
8+
networks:
9+
services-network:
10+
aliases:
11+
- cassandra
12+
13+
statsd:
14+
image: hopsoft/graphite-statsd
15+
ports:
16+
- "8080:80"
17+
- "2003:2003"
18+
- "8125:8125"
19+
- "8126:8126"
20+
networks:
21+
services-network:
22+
aliases:
23+
- statsd
24+
25+
cadence:
26+
image: ubercadence/server:master-auto-setup
27+
ports:
28+
- "7933:7933"
29+
- "7833:7833"
30+
- "7934:7934"
31+
- "7935:7935"
32+
- "7939:7939"
33+
environment:
34+
- "CASSANDRA_SEEDS=cassandra"
35+
- "STATSD_ENDPOINT=statsd:8125"
36+
- "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml"
37+
depends_on:
38+
- cassandra
39+
- statsd
40+
networks:
41+
services-network:
42+
aliases:
43+
- cadence
44+
45+
integ-test-sticky-off:
46+
build:
47+
context: ../../
48+
dockerfile: ./docker/github_actions/Dockerfile
49+
command:
50+
- /bin/sh
51+
- -e
52+
- -c
53+
- |
54+
make integ_test_sticky_off
55+
environment:
56+
- "SERVICE_ADDR=cadence:7933"
57+
- "GO111MODULE=on"
58+
depends_on:
59+
- cadence
60+
volumes:
61+
- ../../:/go/src/go.uber.org/cadence
62+
networks:
63+
services-network:
64+
aliases:
65+
- integ-test-sticky-off
66+
67+
integ-test-sticky-on:
68+
build:
69+
context: ../../
70+
dockerfile: ./docker/github_actions/Dockerfile
71+
command:
72+
- /bin/sh
73+
- -e
74+
- -c
75+
- |
76+
make integ_test_sticky_on
77+
environment:
78+
- "SERVICE_ADDR=cadence:7933"
79+
- "GO111MODULE=on"
80+
depends_on:
81+
- cadence
82+
volumes:
83+
- ../../:/go/src/go.uber.org/cadence
84+
networks:
85+
services-network:
86+
aliases:
87+
- integ-test-sticky-on
88+
89+
integ-test-grpc:
90+
build:
91+
context: ../../
92+
dockerfile: ./docker/github_actions/Dockerfile
93+
command:
94+
- /bin/sh
95+
- -e
96+
- -c
97+
- |
98+
make integ_test_grpc
99+
environment:
100+
- "SERVICE_ADDR=cadence:7833"
101+
- "ENABLE_GRPC_ADAPTER=true"
102+
- "GO111MODULE=on"
103+
depends_on:
104+
- cadence
105+
volumes:
106+
- ../../:/go/src/go.uber.org/cadence
107+
networks:
108+
services-network:
109+
aliases:
110+
- integ-test-grpc
111+
112+
unit-test:
113+
build:
114+
context: ../../
115+
dockerfile: ./docker/github_actions/Dockerfile
116+
command:
117+
- /bin/sh
118+
- -e
119+
- -c
120+
- |
121+
make unit_test
122+
environment:
123+
- "GO111MODULE=on"
124+
volumes:
125+
- ../../:/go/src/go.uber.org/cadence
126+
networks:
127+
services-network:
128+
aliases:
129+
- unit-test
130+
131+
coverage-report:
132+
build:
133+
context: ../../
134+
dockerfile: ./docker/github_actions/Dockerfile
135+
command:
136+
- /bin/sh
137+
- -e
138+
- -c
139+
- |
140+
make coverage_report
141+
environment:
142+
- "GO111MODULE=on"
143+
volumes:
144+
- ../../:/go/src/go.uber.org/cadence
145+
146+
networks:
147+
services-network:
148+
name: services-network
149+
driver: bridge

0 commit comments

Comments
 (0)