Skip to content

Commit 943b3aa

Browse files
committed
Minor darwin tweaks for Makefile and CI
Signed-off-by: apostasie <[email protected]>
1 parent cd62d71 commit 943b3aa

File tree

2 files changed

+85
-2
lines changed

2 files changed

+85
-2
lines changed

.github/workflows/lint.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'release/**'
8+
pull_request:
9+
10+
env:
11+
GO_VERSION: 1.24.x
12+
GOTOOLCHAIN: local
13+
14+
jobs:
15+
go:
16+
timeout-minutes: 5
17+
name: "${{ matrix.goos }} | ${{ matrix.canary }}"
18+
runs-on: "${{ matrix.os }}"
19+
defaults:
20+
run:
21+
shell: bash
22+
strategy:
23+
fail-fast: false
24+
# Note: technically, `make lint-go-all` will run the linter for all platforns, and could be called on a single instance.
25+
# The point of running it instead on a matrix here is to verify that the tooling itself is working on the target OS.
26+
matrix:
27+
include:
28+
- os: ubuntu-24.04
29+
goos: linux
30+
- os: ubuntu-24.04
31+
goos: freebsd
32+
- os: macos-15
33+
# FIXME: this is currently failing in a non-sensical way, so, running on linux instead...
34+
# - os: windows-2022
35+
- os: ubuntu-24.04
36+
goos: windows
37+
- os: ubuntu-24.04
38+
goos: linux
39+
# This allows the canary script to select any upcoming golang alpha/beta/RC
40+
canary: go-canary
41+
steps:
42+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43+
with:
44+
fetch-depth: 1
45+
- name: Set GO env
46+
run: |
47+
# If canary is specified, get the latest available golang pre-release instead of the major version
48+
if [ "${{ matrix.canary }}" != "" ]; then
49+
. ./hack/build-integration-canary.sh
50+
canary::golang::latest
51+
fi
52+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
53+
with:
54+
go-version: ${{ env.GO_VERSION }}
55+
check-latest: true
56+
- name: install required linters and dev-tools
57+
run: |
58+
make install-dev-tools
59+
- name: golangci-lint
60+
run: |
61+
NO_COLOR=true GOOS="${{ matrix.goos }}" make lint-go
62+
other:
63+
timeout-minutes: 5
64+
name: yaml | shell | imports order
65+
runs-on: ubuntu-24.04
66+
steps:
67+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
68+
with:
69+
fetch-depth: 1
70+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
71+
with:
72+
go-version: ${{ env.GO_VERSION }}
73+
check-latest: true
74+
- name: install required linters and dev-tools
75+
run: |
76+
make install-dev-tools
77+
- name: yaml
78+
run: make lint-yaml
79+
- name: shell
80+
run: make lint-shell

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ lint-go-all:
135135
$(call title, $@)
136136
@cd $(MAKEFILE_DIR) \
137137
&& GOOS=linux make lint-go \
138-
&& GOOS=windows make lint-go \
139-
&& GOOS=freebsd make lint-go
138+
&& GOOS=freebsd make lint-go \
139+
&& GOOS=darwin make lint-go \
140+
&& GOOS=windows make lint-go
140141
$(call footer, $@)
141142

142143
lint-yaml:
@@ -180,6 +181,7 @@ lint-licenses-all:
180181
@cd $(MAKEFILE_DIR) \
181182
&& GOOS=linux make lint-licenses \
182183
&& GOOS=freebsd make lint-licenses \
184+
&& GOOS=darwin make lint-licenses \
183185
&& GOOS=windows make lint-licenses
184186
$(call footer, $@)
185187

@@ -197,6 +199,7 @@ fix-go-all:
197199
@cd $(MAKEFILE_DIR) \
198200
&& GOOS=linux make fix-go \
199201
&& GOOS=freebsd make fix-go \
202+
&& GOOS=darwin make fix-go \
200203
&& GOOS=windows make fix-go
201204
$(call footer, $@)
202205

0 commit comments

Comments
 (0)