From 4f4748380d4cc12d2210bb02a78b8e28b7aef2ba Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Sat, 23 Nov 2024 23:46:05 +0530 Subject: [PATCH] chore: support e2e tests on solaris Signed-off-by: Pranshu Srivastava --- .github/workflows/bsd.yml | 55 +++++++++++++++++++++++---------------- Makefile.common | 2 +- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/.github/workflows/bsd.yml b/.github/workflows/bsd.yml index ba9b0e268b..d00fc93839 100644 --- a/.github/workflows/bsd.yml +++ b/.github/workflows/bsd.yml @@ -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: @@ -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: | @@ -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: | @@ -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: | @@ -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::" @@ -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::" diff --git a/Makefile.common b/Makefile.common index 693bbfd737..4a11a4408b 100644 --- a/Makefile.common +++ b/Makefile.common @@ -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; \