Skip to content

Commit 96f2052

Browse files
authored
ci: update Go floor to 1.22 and run CI with 1.22/1.24 (#2379)
Signed-off-by: Anuraag Agrawal <[email protected]>
1 parent 70a9688 commit 96f2052

File tree

23 files changed

+180
-162
lines changed

23 files changed

+180
-162
lines changed

.github/workflows/commit.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- 'netlify.toml'
1515

1616
env: # Update this prior to requiring a higher minor version in go.mod
17-
GO_VERSION: "1.23"
17+
GO_VERSION: "1.24"
1818

1919
defaults:
2020
run: # use bash for all operating systems unless overridden
@@ -71,8 +71,8 @@ jobs:
7171
- os: macos-14
7272
arch: arm64
7373
go-version:
74-
- "1.23" # Current Go version
75-
- "1.21" # Floor Go version of wazero (current - 2)
74+
- "1.24" # Current Go version
75+
- "1.22" # Floor Go version of wazero (current - 2)
7676

7777
steps:
7878

@@ -112,8 +112,8 @@ jobs:
112112
fail-fast: false # don't fail fast as sometimes failures are arch/OS specific
113113
matrix: # Use versions consistent with wazero's Go support policy.
114114
go-version:
115-
- "1.23" # Current Go version
116-
- "1.21" # Floor Go version of wazero (current - 2)
115+
- "1.24" # Current Go version
116+
- "1.22" # Floor Go version of wazero (current - 2)
117117
platform:
118118
- os: ubuntu-22.04
119119
arch: amd64

.github/workflows/examples.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
env:
1919
EMSDK_VERSION: "3.1.40"
2020
TINYGO_VERSION: "0.35.0"
21-
ZIG_VERSION: "0.11.0"
21+
ZIG_VERSION: "0.13.0"
2222

2323
concurrency:
2424
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run
@@ -34,8 +34,8 @@ jobs:
3434
strategy:
3535
matrix:
3636
go-version:
37-
- "1.23"
38-
- "1.21"
37+
- "1.23" # Max version supported by TinyGo 0.35.0
38+
- "1.22"
3939

4040
steps:
4141
- name: Checkout

.github/workflows/integration.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defaults:
1818
shell: bash
1919

2020
env: # Update this prior to requiring a higher minor version in go.mod
21-
GO_VERSION: "1.23"
21+
GO_VERSION: "1.24"
2222
TINYGO_VERSION: "0.35.0"
2323
ZIG_VERSION: "0.11.0"
2424
BINARYEN_VERSION: "116"
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
# Use share the cache containing archives across OSes.
4949
enableCrossOsArchive: true
50-
key: zig-stdlib-test-binary-${{ env.ZIG_VERSION }}
50+
key: zig-stdlib-test-binary-${{ env.ZIG_VERSION }}-${{ hashFiles(format('{0}/Makefile', env.STDLIB_TESTS)) }}
5151
path:
5252
${{ env.STDLIB_TESTS }}/testdata/zig
5353

@@ -132,7 +132,7 @@ jobs:
132132
with:
133133
# Use share the cache containing archives across OSes.
134134
enableCrossOsArchive: true
135-
key: tinygo-test-binaries-${{ env.TINYGO_VERSION }}
135+
key: tinygo-test-binaries-${{ env.TINYGO_VERSION }}-${{ hashFiles(format('{0}/Makefile', env.STDLIB_TESTS)) }}
136136
path:
137137
${{ env.STDLIB_TESTS }}/testdata/tinygo
138138

@@ -147,7 +147,7 @@ jobs:
147147
- uses: actions/setup-go@v5
148148
if: steps.binary-cache.outputs.cache-hit != 'true'
149149
with:
150-
go-version: ${{ env.GO_VERSION }}
150+
go-version: 1.23 # Latest supported by TinyGo 0.35
151151

152152
- name: Build Test Binaries
153153
if: steps.binary-cache.outputs.cache-hit != 'true'
@@ -192,7 +192,7 @@ jobs:
192192

193193
- uses: actions/setup-go@v5
194194
with:
195-
go-version: ${{ env.GO_VERSION }}
195+
go-version: 1.23 # Latest supported by TinyGo 0.35
196196

197197
- name: Run test binaries
198198
run: |
@@ -276,8 +276,8 @@ jobs:
276276
name: Windows
277277
arch: amd64
278278
go-version:
279-
- "1.23"
280-
- "1.21"
279+
- "1.24"
280+
- "1.22"
281281

282282
steps:
283283
- id: setup-go
@@ -295,7 +295,7 @@ jobs:
295295
path:
296296
${{ env.STDLIB_TESTS }}/testdata/go
297297
# Use precise Go version from setup-go as patch version differences can effect tests.
298-
key: go-wasip1-binaries-${{ matrix.os.version }}-${{ steps.setup-go.outputs.go-version }}-${{ matrix.os.arch }}
298+
key: go-wasip1-binaries-${{ matrix.os.version }}-${{ steps.setup-go.outputs.go-version }}-${{ matrix.os.arch }}-${{ hashFiles(format('{0}/Makefile', env.STDLIB_TESTS)) }}
299299

300300
- if: ${{ steps.cache-go-test-binaries.outputs.cache-hit != 'true' }}
301301
name: Build Test Binaries

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
tags: 'v[0-9]+.[0-9]+.[0-9]+**' # Ex. v0.2.0 v0.2.1-rc2
1212

1313
env: # Update this prior to requiring a higher minor version in go.mod
14-
GO_VERSION: "1.23"
14+
GO_VERSION: "1.24"
1515

1616
defaults:
1717
run: # use bash for all operating systems unless overridden

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ package-lock.json
3636
.vagrant
3737

3838
zig-cache/
39+
.zig-cache/
3940
zig-out/
4041

4142
.DS_Store

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
gofumpt := mvdan.cc/[email protected]
33
gosimports := github.com/rinchsan/gosimports/cmd/[email protected]
4-
golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.0
4+
golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.5
55
asmfmt := github.com/klauspost/asmfmt/cmd/[email protected]
66
# sync this with netlify.toml!
77
hugo := github.com/gohugoio/[email protected]
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
const std = @import("std");
22
const CrossTarget = std.zig.CrossTarget;
33

4-
pub fn build(b: *std.build.Builder) void {
5-
const target = .{.cpu_arch = .wasm32, .os_tag = .freestanding};
6-
const optimize = b.standardOptimizeOption(.{});
7-
8-
const lib = b.addSharedLibrary(.{
4+
pub fn build(b: *std.Build) void {
5+
const lib = b.addExecutable(.{
96
.name = "greet",
10-
.root_source_file = .{ .path = "greet.zig" },
11-
.target = target,
12-
.optimize = optimize,
7+
.root_source_file = b.path("greet.zig"),
8+
.target = b.resolveTargetQuery(.{
9+
.cpu_arch = .wasm32,
10+
.os_tag = .freestanding,
11+
}),
12+
.optimize = b.standardOptimizeOption(.{}),
1313
});
14+
lib.entry = .disabled;
1415
lib.rdynamic = true;
1516
b.installArtifact(lib);
1617
}
276 Bytes
Binary file not shown.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module github.com/tetratelabs/wazero
22

33
// Floor Go version of wazero (current - 2)
4-
go 1.21
4+
go 1.22.0
55

66
// All the beta tags are retracted and replaced with "pre" to prevent users
77
// from accidentally upgrading into the broken beta 1.
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
const std = @import("std");
22
const CrossTarget = std.zig.CrossTarget;
33

4-
pub fn build(b: *std.build.Builder) void {
5-
const target = .{.cpu_arch = .wasm32, .os_tag = .wasi};
6-
const optimize = b.standardOptimizeOption(.{});
7-
4+
pub fn build(b: *std.Build) void {
85
const exe = b.addExecutable(.{
96
.name = "cat",
10-
.root_source_file = .{ .path = "cat.zig" },
11-
.target = target,
12-
.optimize = optimize,
7+
.root_source_file = b.path("cat.zig"),
8+
.target = b.resolveTargetQuery(.{
9+
.cpu_arch = .wasm32,
10+
.os_tag = .wasi,
11+
}),
12+
.optimize = b.standardOptimizeOption(.{}),
1313
});
14-
15-
exe.install();
14+
b.installArtifact(exe);
1615
}

0 commit comments

Comments
 (0)