Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 37 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -17,42 +17,65 @@
#

name: Build

on:
pull_request:
push:
branches:
- main

jobs:
build:
name: Build
lint-and-test:
name: Lint and Test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25
cache-dependency-path: |
go.sum
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Check License
uses: apache/skywalking-eyes@ec88b7d850018c8983f87729ea88549e100c5c82
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Lint Codes
run: make lint

- name: Test
run: make test

run: CGO_ENABLED=1 make test
build-platform:
name: Build (${{ matrix.os }})
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.25
cache-dependency-path: |
go.sum
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Build
run: make build

- name: Build Docker Image
if: matrix.os == 'ubuntu-latest'
run: make docker
build:
name: Build
runs-on: ubuntu-latest
needs:
- lint-and-test
- build-platform
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Result
run: echo "Lint and Test, Build (ubuntu-latest), Build (windows-latest), Build (macos-latest) completed successfully!"
15 changes: 3 additions & 12 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@
#

name: E2E Test

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
pull_request:
branches:
- main

jobs:
build:
name: E2E Test
Expand All @@ -35,17 +32,14 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25
cache-dependency-path: |
go.sum
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Build e2e
run: make linux

run: CGO_ENABLED=1 make linux
- name: Install docker-compose
shell: bash
run: |
Expand All @@ -54,15 +48,12 @@ jobs:
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
fi

- name: Run E2E Test
uses: apache/skywalking-infra-e2e@main
with:
e2e-file: ./test/e2e/e2e.yaml

- uses: engineerd/setup-kind@v0.6.2
with:
version: "v0.27.0"

version: v0.27.0
- name: Run KinD E2E Test
run: make e2e-test-kind
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ version: "2"

run:
tests: false
go: "1.24"
go: "1.25"

linters:
default: standard
Expand Down
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@
# under the License.
#

FROM golang:1.24 AS build
FROM golang:1.25 AS build

WORKDIR /e2e

COPY . .

RUN make linux
# Install build dependencies for CGO
RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*

FROM golang:1.24 AS bin
RUN CGO_ENABLED=1 make linux

FROM golang:1.25 AS bin

COPY --from=build /e2e/bin/linux/e2e /usr/local/bin/e2e

Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ GO := GO111MODULE=on go
GO_PATH = $(shell $(GO) env GOPATH)
GOARCH ?= $(shell $(GO) env GOARCH)
GOOS ?= $(shell $(GO) env GOOS)
HOST_GOOS = $(shell $(GO) env GOOS)
HOST_GOARCH = $(shell $(GO) env GOARCH)
# CGO is enabled only for native builds; cross-compilation requires target SDK
CGO_FLAG = $(shell if [ "$(os)" = "$(HOST_GOOS)" ] && [ "$(GOARCH)" = "$(HOST_GOARCH)" ]; then echo 1; else echo 0; fi)
GO_BUILD = $(GO) build
GO_TEST = $(GO) test
GO_LINT = $(GO_PATH)/bin/golangci-lint
Expand All @@ -40,7 +44,7 @@ all: clean lint test build

.PHONY: lint
lint:
$(GO_LINT) version || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin -d "v2.1.6"
$(GO_LINT) version || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin -d "v2.9.0"
$(GO_LINT) run -v ./...

.PHONY: fix-lint
Expand All @@ -57,10 +61,10 @@ windows: PROJECT_SUFFIX=.exe
.PHONY: $(PLATFORMS)
$(PLATFORMS):
mkdir -p $(OUT_DIR)
GOOS=$(os) GOARCH=$(GOARCH) $(GO_BUILD) $(GO_BUILD_FLAGS) -ldflags "$(GO_BUILD_LDFLAGS)" -o $(OUT_DIR)/$(os)/$(PROJECT)$(PROJECT_SUFFIX) cmd/e2e/main.go
GOOS=$(os) GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_FLAG) $(GO_BUILD) $(GO_BUILD_FLAGS) -ldflags "$(GO_BUILD_LDFLAGS)" -o $(OUT_DIR)/$(os)/$(PROJECT)$(PROJECT_SUFFIX) cmd/e2e/main.go

.PHONY: build
build: windows linux darwin
build: $(GOOS)

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.24
go-version: 1.25
cache-dependency-path: ${{ github.action_path }}/go.sum
- shell: bash
run: make -C $GITHUB_ACTION_PATH install DESTDIR=/usr/local/bin
Expand Down
Loading
Loading