Skip to content

Commit

Permalink
chore: build on multiple GOOS/GOARCH
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jun 27, 2024
1 parent 7cde539 commit d061201
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests
name: Tests and Build

on:
push:
Expand All @@ -9,8 +9,8 @@ on:

jobs:

cross:
name: Go
tests:
name: Tests
strategy:
matrix:
go-version: [ stable, oldstable ]
Expand All @@ -33,3 +33,14 @@ jobs:
- name: Test
run: go test -v -race ./...

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: compile for all supported GOOS/GOARCH
run: ./build.sh
19 changes: 19 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash -e

# Not supported by flock:
# - plan9/*
# - solaris/*
# - js/wasm
# - wasp1/wasm

for row in $(go tool dist list -json | jq -r '.[] | select( .GOOS != "plan9" and .GOOS != "solaris" and .GOARCH != "wasm") | @base64'); do
_jq() {
echo ${row} | base64 --decode | jq -r ${1}
}

GOOS=$(_jq '.GOOS')
GOARCH=$(_jq '.GOARCH')

echo "$GOOS/$GOARCH"
GOOS=$GOOS GOARCH=$GOARCH go build
done

0 comments on commit d061201

Please sign in to comment.