Skip to content

Commit 3c46675

Browse files
jsuerethdjaglowski
andauthored
Add github action for validation with public logs. (open-telemetry#53)
* Add a GHA that does most of what kokoro does. * Add endline. * Attempt to fix lint error with new go version. * Another attempted fix. * Move tools into internal module (open-telemetry#54) Co-authored-by: Daniel Jaglowski <[email protected]>
1 parent f5d8b62 commit 3c46675

File tree

5 files changed

+1284
-5
lines changed

5 files changed

+1284
-5
lines changed

.github/workflows/presubmit.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Presubmit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
env:
8+
# Default minimum version of Go to support.
9+
DEFAULT_GO_VERSION: 1.16
10+
jobs:
11+
build:
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
submodules: true
17+
fetch-depth: 0
18+
lfs: true
19+
- uses: actions/[email protected]
20+
with:
21+
go-version: ${{ env.DEFAULT_GO_VERSION }}
22+
- name: Setup Go Environment
23+
run: |
24+
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
25+
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
26+
shell: bash
27+
- name: Build and test
28+
run: make install-tools && make presubmit

Makefile

+7-5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ BUILD_X1 := -X $(BUILD_INFO_IMPORT_PATH).GitHash=$(GIT_SHA)
3333
BUILD_X2 := -X $(BUILD_INFO_IMPORT_PATH).Version=$(PKG_VERSION)
3434
LD_FLAGS := -ldflags "${BUILD_X1} ${BUILD_X2}"
3535

36+
TOOLS_DIR := internal/tools
37+
3638
.EXPORT_ALL_VARIABLES:
3739

3840
.DEFAULT_GOAL := presubmit
@@ -43,11 +45,11 @@ LD_FLAGS := -ldflags "${BUILD_X1} ${BUILD_X2}"
4345

4446
.PHONY: install-tools
4547
install-tools:
46-
go get github.com/client9/misspell/cmd/misspell
47-
go get github.com/golangci/golangci-lint/cmd/golangci-lint
48-
go get github.com/google/addlicense
49-
go get github.com/google/googet/goopack
50-
go get github.com/pavius/impi/cmd/impi
48+
cd $(TOOLS_DIR) && go install github.com/client9/misspell/cmd/misspell
49+
cd $(TOOLS_DIR) && go install github.com/golangci/golangci-lint/cmd/golangci-lint
50+
cd $(TOOLS_DIR) && go install github.com/google/addlicense
51+
cd $(TOOLS_DIR) && go install github.com/google/googet/goopack
52+
cd $(TOOLS_DIR) && go install github.com/pavius/impi/cmd/impi
5153

5254
# --------------------------
5355
# Helper Commands

internal/tools/go.mod

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module github.com/GoogleCloudPlatform/opentelemetry-operations-collector
2+
3+
go 1.16
4+
5+
require (
6+
github.com/blang/semver v3.5.1+incompatible // indirect
7+
github.com/client9/misspell v0.3.4
8+
github.com/golangci/golangci-lint v1.42.0
9+
github.com/google/addlicense v1.0.0
10+
github.com/google/googet v2.13.0+incompatible
11+
github.com/pavius/impi v0.0.3
12+
)

0 commit comments

Comments
 (0)