Skip to content

Commit

Permalink
chore: support e2e tests on solaris
Browse files Browse the repository at this point in the history
Signed-off-by: Pranshu Srivastava <[email protected]>
  • Loading branch information
rexagod committed Nov 23, 2024
1 parent a2bc990 commit 4f47483
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 24 deletions.
55 changes: 32 additions & 23 deletions .github/workflows/bsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ env:
GO_VERSION_FREEBSD: "123"
GO_VERSION_OPENBSD: "1.23.1"
GO_VERSION_NETBSD: "123"
GO_VERSION_DRAGONFLY: "1.23"
GO_VERSION_SOLARIS: "1.23.3"
GNU_TAR_VERSION: "1.35"

jobs:
Expand All @@ -29,6 +31,7 @@ jobs:
uses: vmactions/freebsd-vm@v1
if: false # this already passes, so skip to test other BSDs faster
with:
copyback: false
envs: 'GO_VERSION_FREEBSD GNU_TAR_VERSION'
usesh: true
prepare: |
Expand Down Expand Up @@ -60,6 +63,7 @@ jobs:
uses: vmactions/openbsd-vm@v1
if: false
with:
copyback: false
envs: 'GO_VERSION_OPENBSD GNU_TAR_VERSION'
usesh: true
prepare: |
Expand All @@ -86,7 +90,9 @@ jobs:
- name: Run end-to-end tests on NetBSD
uses: vmactions/netbsd-vm@v1
if: false
with:
copyback: false
envs: 'GO_VERSION_NETBSD GNU_TAR_VERSION'
usesh: true
prepare: |
Expand Down Expand Up @@ -114,24 +120,25 @@ jobs:
- name: Run end-to-end tests on DragonFly
uses: vmactions/dragonflybsd-vm@v1
if: false
with:
envs: 'GO_VERSION'
copyback: false
envs: 'GO_VERSION_DRAGONFLY GNU_TAR_VERSION'
usesh: true
prepare: |
pkg update -f
pkg install -y bash curl git gmake gsed gnugrep go${GO_VERSION} python
run: |
pkgutil -U
pkgutil -y -i bash curl gtar gmake gsed ggrep go python
run: | # DragonFly6.4 ships with Go 1.21.
set -eux
mkdir bin
ln -s $(which go${GO_VERSION}) bin/go
ln -s $(which gsed) bin/sed
ln -s $(which gnugrep) bin/grep
ln -s $(which go${GO_VERSION_FREEBSD}) bin/go
ln -s $(which ggrep) bin/grep
ln -s $(which gmake) bin/make
export PATH=$PATH:$(pwd)/golang-bin
ln -s $(which gsed) bin/sed
ln -s $(which gtar) bin/tar
export PATH=$(pwd)/bin:$PATH
echo "::group::Print environment information"
freebsd-version
uname -a
echo "GOOS: $(go env GOOS)"
echo "GOARCH: $(go env GOARCH)"
echo "::endgroup::"
Expand All @@ -144,23 +151,25 @@ jobs:
- name: Run end-to-end tests on Solaris
uses: vmactions/solaris-vm@v1
with:
envs: 'GO_VERSION'
copyback: false
envs: 'GO_VERSION_SOLARIS'
usesh: true
prepare: |
pkgutil update -f
pkgutil install -y bash curl git gmake gsed gnugrep go${GO_VERSION} python
run: |
prepare: | # Solaris 11.4 ships with Go 1.17.
pkgutil -U
pkgutil --force install bash curl gtar git gmake gsed ggrep python33
run: |
set -eux
mkdir bin
ln -s $(which go${GO_VERSION}) bin/go
ln -s $(which gsed) bin/sed
ln -s $(which gnugrep) bin/grep
ln -s $(which gmake) bin/make
export PATH=$PATH:$(pwd)/golang-bin
mkdir bbin
curl -LO https://go.dev/dl/go1.23.3.solaris-amd64.tar.gz
tar xzf go1.23.3.solaris-amd64.tar.gz
ln -s go/bin/go bbin/go
ln -s $(which ggrep) bbin/grep
ln -s $(which gmake) bbin/make
ln -s $(which gsed) bbin/sed
ln -s $(which gtar) bbin/tar
export PATH=$(pwd)/bbin:$PATH
echo "::group::Print environment information"
freebsd-version
uname -a
echo "GOOS: $(go env GOOS)"
echo "GOARCH: $(go env GOARCH)"
echo "::endgroup::"
Expand Down
2 changes: 1 addition & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ common-build: promu
@echo ">> building binaries"
@$(PROMU) build --prefix $(PREFIX) $(PROMU_BINARIES)
@# Use the codesign binary directly instead of `promu codesign` as it depends on an image that doesn't support linux/arm64 (w.r.t. darwin's rosetta emulation) yet.
@if [ "$(GOHOSTOS)" == "darwin" ]; then \
@if [ "$(GOHOSTOS)" = "darwin" ]; then \
if command -v codesign > /dev/null 2>&1; then \
codesign --sign - --force --preserve-metadata=entitlements,requirements,flags,runtime node_exporter ;\
fi; \
Expand Down

0 comments on commit 4f47483

Please sign in to comment.