Skip to content

Commit

Permalink
Merge pull request #7 from buildbarn/cgo
Browse files Browse the repository at this point in the history
Use cgo platforms and disable 32-bit builds in CI
  • Loading branch information
mortenmj authored Oct 7, 2024
2 parents c93f9cb + ff0cfe9 commit e8dcac3
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 58 deletions.
56 changes: 12 additions & 44 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
},
{
"name": "linux_amd64: build and test",
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_amd64 //..."
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_amd64_cgo //..."
},
{
"name": "linux_amd64: copy bb_portal",
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_amd64 //cmd/bb_portal $(pwd)/bb_portal"
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_amd64_cgo //cmd/bb_portal $(pwd)/bb_portal"
},
{
"name": "linux_amd64: upload bb_portal",
Expand All @@ -67,45 +67,13 @@
"path": "bb_portal"
}
},
{
"name": "linux_386: build and test",
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_386 //..."
},
{
"name": "linux_386: copy bb_portal",
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_386 //cmd/bb_portal $(pwd)/bb_portal"
},
{
"name": "linux_386: upload bb_portal",
"uses": "actions/upload-artifact@v4",
"with": {
"name": "bb_portal.linux_386",
"path": "bb_portal"
}
},
{
"name": "linux_arm: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm //..."
},
{
"name": "linux_arm: copy bb_portal",
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm //cmd/bb_portal $(pwd)/bb_portal"
},
{
"name": "linux_arm: upload bb_portal",
"uses": "actions/upload-artifact@v4",
"with": {
"name": "bb_portal.linux_arm",
"path": "bb_portal"
}
},
{
"name": "linux_arm64: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64 //..."
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64_cgo //..."
},
{
"name": "linux_arm64: copy bb_portal",
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm64 //cmd/bb_portal $(pwd)/bb_portal"
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm64_cgo //cmd/bb_portal $(pwd)/bb_portal"
},
{
"name": "linux_arm64: upload bb_portal",
Expand All @@ -117,11 +85,11 @@
},
{
"name": "darwin_amd64: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64_cgo //..."
},
{
"name": "darwin_amd64: copy bb_portal",
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_amd64 //cmd/bb_portal $(pwd)/bb_portal"
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_amd64_cgo //cmd/bb_portal $(pwd)/bb_portal"
},
{
"name": "darwin_amd64: upload bb_portal",
Expand All @@ -133,11 +101,11 @@
},
{
"name": "darwin_arm64: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64_cgo //..."
},
{
"name": "darwin_arm64: copy bb_portal",
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_arm64 //cmd/bb_portal $(pwd)/bb_portal"
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_arm64_cgo //cmd/bb_portal $(pwd)/bb_portal"
},
{
"name": "darwin_arm64: upload bb_portal",
Expand All @@ -149,11 +117,11 @@
},
{
"name": "freebsd_amd64: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_portal"
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64_cgo //cmd/bb_portal"
},
{
"name": "freebsd_amd64: copy bb_portal",
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_portal $(pwd)/bb_portal"
"run": "rm -f bb_portal && bazel run --run_under cp --platforms=@rules_go//go/toolchain:freebsd_amd64_cgo //cmd/bb_portal $(pwd)/bb_portal"
},
{
"name": "freebsd_amd64: upload bb_portal",
Expand All @@ -165,11 +133,11 @@
},
{
"name": "windows_amd64: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //..."
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64_cgo //..."
},
{
"name": "windows_amd64: copy bb_portal",
"run": "rm -f bb_portal.exe && bazel run --run_under cp --platforms=@rules_go//go/toolchain:windows_amd64 //cmd/bb_portal $(pwd)/bb_portal.exe"
"run": "rm -f bb_portal.exe && bazel run --run_under cp --platforms=@rules_go//go/toolchain:windows_amd64_cgo //cmd/bb_portal $(pwd)/bb_portal.exe"
},
{
"name": "windows_amd64: upload bb_portal",
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/pull-requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,25 @@
"name": "linux_amd64: build and test",
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_amd64_cgo //..."
},
{
"name": "linux_386: build and test",
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_386 //..."
},
{
"name": "linux_arm: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm //..."
},
{
"name": "linux_arm64: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64 //..."
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64_cgo //..."
},
{
"name": "darwin_amd64: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64_cgo //..."
},
{
"name": "darwin_arm64: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64_cgo //..."
},
{
"name": "freebsd_amd64: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_portal"
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64_cgo //cmd/bb_portal"
},
{
"name": "windows_amd64: build and test",
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //..."
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64_cgo //..."
}
]
}
Expand Down
5 changes: 4 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ git_override(

git_override(
module_name = "com_github_buildbarn_bb_storage",
commit = "8abbcfab01bcde294b20c2070baba9fd242bab7f",
commit = "0941111f29e31905e4081e6262bccf0c123940ed",
patches = [
"//:patches/com_buildbarn_bb_storage/workflows_template.diff",
],
remote = "https://github.com/buildbarn/bb-storage.git",
)

Expand Down
38 changes: 38 additions & 0 deletions patches/com_buildbarn_bb_storage/workflows_template.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git tools/github_workflows/workflows_template.libsonnet tools/github_workflows/workflows_template.libsonnet
index 1016937..5bee227 100644
--- tools/github_workflows/workflows_template.libsonnet
+++ tools/github_workflows/workflows_template.libsonnet
@@ -6,18 +6,6 @@
buildJustBinaries: false,
extension: '',
},
- {
- name: 'linux_386',
- buildAndTestCommand: 'test --test_output=errors',
- buildJustBinaries: false,
- extension: '',
- },
- {
- name: 'linux_arm',
- buildAndTestCommand: 'build',
- buildJustBinaries: false,
- extension: '',
- },
{
name: 'linux_arm64',
buildAndTestCommand: 'build',
@@ -192,12 +180,12 @@
'master.yaml': {
name: 'master',
on: { push: { branches: ['main', 'master'] } },
- jobs: getJobs(binaries, containers, true, false),
+ jobs: getJobs(binaries, containers, true, true),
},
'pull-requests.yaml': {
name: 'pull-requests',
on: { pull_request: { branches: ['main', 'master'] } },
- jobs: getJobs(binaries, containers, false, false),
+ jobs: getJobs(binaries, containers, false, true),
},
},
}

0 comments on commit e8dcac3

Please # to comment.