Skip to content

Commit 5722419

Browse files
authored
Merge pull request #25179 from redpanda-data/DEVPROD-2669-fix-rpk-build-v24.2.x
[v24.2.x] gha/rpk-build: test and build multi os and arch
2 parents 855abeb + 333a26b commit 5722419

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

.github/workflows/rpk-build.yml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# Copyright 2020 Redpanda Data, Inc.
23
#
34
# Use of this software is governed by the Business Source License
@@ -6,39 +7,47 @@
67
# As of the Change Date specified in that file, in accordance with
78
# the Business Source License, use of this software will be governed
89
# by the Apache License, Version 2.0
9-
1010
name: rpk
1111
on:
1212
push:
13-
branches:
14-
- 'dev'
13+
branches: [dev]
1514
paths:
1615
- 'src/go/rpk/**'
1716
- '.github/workflows/rpk-build.yml'
1817
pull_request:
1918
paths:
2019
- 'src/go/rpk/**'
2120
- '.github/workflows/rpk-build.yml'
22-
2321
jobs:
22+
build:
23+
strategy:
24+
matrix:
25+
goos: [linux, darwin, windows]
26+
goarch: [amd64, arm64]
27+
exclude:
28+
- goos: linux
29+
goarch: amd64
30+
- goos: darwin
31+
goarch: arm64
32+
runs-on: ubuntu-24.04
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-go@v5
36+
with:
37+
go-version: stable
38+
cache-dependency-path: 'src/go/rpk/go.sum'
39+
- run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o rpk cmd/rpk/main.go
40+
working-directory: src/go/rpk/
2441
test:
25-
name: Test rpk
2642
strategy:
2743
matrix:
28-
os: [linux, darwin, windows]
29-
arch: [amd64, arm64]
30-
runs-on: ubuntu-latest
44+
runner: [ubuntu-24.04, macos-15]
45+
runs-on: ${{ matrix.runner }}
3146
steps:
32-
33-
- name: Check out code
34-
uses: actions/checkout@v4
35-
36-
- name: Set up Go
37-
uses: actions/setup-go@v5
47+
- uses: actions/checkout@v4
48+
- uses: actions/setup-go@v5
3849
with:
3950
go-version: stable
4051
cache-dependency-path: 'src/go/rpk/go.sum'
41-
42-
- name: Run tests
52+
- run: go run gotest.tools/gotestsum@v1.12.0 -- -cover ./...
4353
working-directory: src/go/rpk/
44-
run: go run gotest.tools/gotestsum@v1.11.0 -- -cover ./...

0 commit comments

Comments
 (0)