Skip to content

Commit 1f71456

Browse files
committed
restore Github Action presubmits
1 parent f88562c commit 1f71456

File tree

4 files changed

+60
-16
lines changed

4 files changed

+60
-16
lines changed

.github/workflows/presubmit.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Presubmit
16+
17+
on:
18+
pull_request:
19+
branches:
20+
- master
21+
22+
env:
23+
# Default minimum version of Go to support.
24+
DEFAULT_GO_VERSION: 1.24.1
25+
jobs:
26+
build:
27+
strategy:
28+
matrix:
29+
os: [ubuntu-24.04]
30+
go: [1.24.1]
31+
runs-on: ${{matrix.os}}
32+
steps:
33+
- uses: actions/setup-go@v3
34+
with:
35+
go-version: ${{ matrix.go }}
36+
cache: true
37+
- name: Install Tools
38+
run: make install-tools
39+
- name: Run presubmit (GPU off)
40+
run: make presubmit
41+
- name: Run presubmit (GPU on)
42+
run: GO_BUILD_TAGS=gpu make presubmit

Makefile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ setup-hooks:
1414
.PHONY: precommit
1515
precommit: checklicense misspell lint
1616

17+
# This is the same as precommit for now but this is
18+
# futureproofing against this changing in the future.
19+
.PHONY: presubmit
20+
presubmit: checklicense misspell lint
21+
1722
##########################
1823
# Updating OTel Components
1924
##########################
@@ -90,6 +95,10 @@ test-all:
9095
tidy-all:
9196
TARGET="tidy" $(MAKE) target-all-modules
9297

98+
.PHONY: distrogen-golden-update
99+
distrogen-golden-update:
100+
go test ./cmd/distrogen -update
101+
93102
###########
94103
# Workspace
95104
###########
@@ -141,7 +150,14 @@ install-tools: tools-dir
141150
GOBIN=$(TOOLS_DIR) go install \
142151
$(TOOL_LIST)
143152

144-
ADDLICENSE_IGNORES = -ignore "**/.tools/*" -ignore "**/otelopscol/**/*" -ignore "**/google-otel/**/*" -ignore "**/docs/**/*" -ignore "**/*.md" -ignore "**/testdata/*"
153+
ADDLICENSE_IGNORES = -ignore "**/.tools/*" \
154+
-ignore "**/otelopscol/**/*" \
155+
-ignore "**/google-otel/**/*" \
156+
-ignore "**/docs/**/*" \
157+
-ignore "**/*.md" \
158+
-ignore "**/testdata/*" \
159+
-ignore "**/golden/*" \
160+
-ignore "**/spec.yaml"
145161
.PHONY: addlicense
146162
addlicense:
147163
$(ADDLICENSE) -c "Google LLC" -l apache $(ADDLICENSE_IGNORES) .

cmd/distrogen/testdata/generator/basic/golden/spec.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
# Copyright 2025 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
151
name: basic-distro
162
display_name: Basic OTel
173
description: A basic distribution of the OpenTelemetry Collector

make/common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TODO: This could be better
22
.PHONY: test
33
test:
4-
go test ./...
4+
go test -tags=$(GO_BUILD_TAGS) ./...
55

66
.PHONY: tidy
77
tidy:

0 commit comments

Comments
 (0)