From 68a9acd049fca3621253f865fe7a9d75d065c992 Mon Sep 17 00:00:00 2001 From: John Barton Date: Wed, 11 Nov 2020 11:44:16 +1100 Subject: [PATCH] Add non-amd64 tests --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b31cdbf..6f62821 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,9 +3,10 @@ name: CI on: [push] jobs: - build: + test: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: go: [ '1.15', '1.14' ] os: [ ubuntu-latest, macOS-latest, windows-latest ] @@ -16,4 +17,46 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} - - run: go test \ No newline at end of file + - run: go test + + test-non-amd64: + strategy: + fail-fast: false + matrix: + arch: + - name: IBM Z and LinuxONE + architecture: "s390x" + - name: POWER8 + architecture: "ppc64le" + + runs-on: ubuntu-latest + name: Build on ${{ matrix.arch.name }} + steps: + - uses: actions/checkout@v2 + - uses: uraimo/run-on-arch-action@master + env: + GOARCH: ${{ matrix.arch.architecture }} + CGO_ENABLED: 0 + with: + architecture: ${{ matrix.arch.architecture }} + distribution: ubuntu20.04 + additionalArgs: -e GOARCH -e CGO_ENABLED + run: | + apt-get update + apt install -y curl wget + latestGo=$(curl "https://golang.org/VERSION?m=text") + wget "https://dl.google.com/go/${latestGo}.linux-${GOARCH}.tar.gz" + rm -f $(which go) + rm -rf /usr/local/go + tar -C /usr/local -xzf "${latestGo}.linux-${GOARCH}.tar.gz" + export PATH=/usr/local/go/bin:$PATH + printf "Using go at: $(which go)\n" + printf "Go version: $(go version)\n" + printf "\n\nGo environment:\n\n" + go env + printf "\n\nSystem environment:\n\n" + env + go get -insecure -v -t -d ./... + go test ./... + cd ./cmd/godotenv + go build -trimpath -ldflags="-w -s" -v \ No newline at end of file