Skip to content

Commit de56b07

Browse files
authored
Merge pull request #502 from andyzhangx/build-test
test: add github action build test
2 parents b09ca9e + 19e8f62 commit de56b07

File tree

4 files changed

+35
-45
lines changed

4 files changed

+35
-45
lines changed

.github/workflows/build.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Ubuntu Build Test
2+
3+
on:
4+
pull_request: {}
5+
push: {}
6+
7+
jobs:
8+
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- name: Set up Go 1.x
15+
uses: actions/setup-go@v2
16+
with:
17+
go-version: ^1.16
18+
id: go
19+
20+
- name: Check out code into the Go module directory
21+
uses: actions/checkout@v2
22+
23+
- name: Build Test
24+
run: |
25+
make
26+
make -C lib/go protoc
27+
make -C lib/go protoc-gen-go
28+
make build_go

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@ CSI_PKG := lib/go/csi
1010
# This is the target for building the temporary CSI protobuf file.
1111
#
1212
# The temporary file is not versioned, and thus will always be
13-
# built on Travis-CI.
13+
# built on GitHub Actions.
1414
$(CSI_PROTO).tmp: $(CSI_SPEC) Makefile
1515
echo "// Code generated by make; DO NOT EDIT." > "$@"
1616
cat $< | sed -n -e '/```protobuf$$/,/^```$$/ p' | sed '/^```/d' >> "$@"
1717

1818
# This is the target for building the CSI protobuf file.
1919
#
2020
# This target depends on its temp file, which is not versioned.
21-
# Therefore when built on Travis-CI the temp file will always
22-
# be built and trigger this target. On Travis-CI the temp file
21+
# Therefore when built on GitHub Actions the temp file will always
22+
# be built and trigger this target. On GitHub Actions the temp file
2323
# is compared with the real file, and if they differ the build
2424
# will fail.
2525
#
2626
# Locally the temp file is simply copied over the real file.
2727
$(CSI_PROTO): $(CSI_PROTO).tmp
28-
ifeq (true,$(TRAVIS))
28+
ifeq (true,$(GITHUB_ACTIONS))
2929
diff "$@" "$?"
3030
else
3131
diff "$@" "$?" > /dev/null 2>&1 || cp -f "$?" "$@"
3232
endif
3333

3434
build: check
3535

36-
# If this is not running on Travis-CI then for sake of convenience
36+
# If this is not running on GitHub Actions then for sake of convenience
3737
# go ahead and update the language bindings as well.
38-
ifneq (true,$(TRAVIS))
38+
ifneq (true,$(GITHUB_ACTIONS))
3939
build: build_cpp build_go
4040
endif
4141

lib/go/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ $(CSI_GO_TMP): $(CSI_PROTO) | $(PROTOC) $(PROTOC_GEN_GO)
106106
# versioned. If they are different then it means the language
107107
# bindings were not updated prior to being committed.
108108
$(CSI_GO): $(CSI_GO_TMP)
109-
ifeq (true,$(TRAVIS))
109+
ifeq (true,$(GITHUB_ACTIONS))
110110
diff "$@" "$?"
111111
else
112112
@mkdir -p "$(@D)"

0 commit comments

Comments
 (0)