From ee52f29c3315443b85ef67113dd68ab1853cf1f8 Mon Sep 17 00:00:00 2001 From: Alexander <4584443+DragonStuff@users.noreply.github.com> Date: Sat, 28 Aug 2021 10:53:24 +0900 Subject: [PATCH] feature(ci): recognise more arches and add build tests --- .github/workflows/container_release.yml | 1 + .github/workflows/container_test.yml | 1 + .github/workflows/release_test.yml | 46 +++++++++++++++++++++++++ docker/Dockerfile | 4 ++- 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release_test.yml diff --git a/.github/workflows/container_release.yml b/.github/workflows/container_release.yml index 1b155b7bd..3c66c7215 100644 --- a/.github/workflows/container_release.yml +++ b/.github/workflows/container_release.yml @@ -1,4 +1,5 @@ name: Build Release Containers + on: push: tags: diff --git a/.github/workflows/container_test.yml b/.github/workflows/container_test.yml index dbb542e54..7ba460cf2 100644 --- a/.github/workflows/container_test.yml +++ b/.github/workflows/container_test.yml @@ -1,4 +1,5 @@ name: Test Building Container Images + on: push: pull_request: diff --git a/.github/workflows/release_test.yml b/.github/workflows/release_test.yml new file mode 100644 index 000000000..d99d40620 --- /dev/null +++ b/.github/workflows/release_test.yml @@ -0,0 +1,46 @@ +name: Build Dev Binaries + +on: + push: + pull_request: + workflow_dispatch: [] + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux, windows, darwin, freebsd, netbsd, openbsd] + goarch: [amd64, arm, arm64, 386, ppc64le, s390x] + exclude: + - goarch: arm + goos: darwin + - goarch: 386 + goos: darwin + - goarch: ppc64le + goos: darwin + - goarch: s390x + goos: darwin + - goarch: arm + goos: windows + - goarch: arm64 + goos: windows + - goarch: ppc64le + goos: windows + - goarch: s390x + goos: windows + + steps: + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Go cross-platform build test + uses: thatisuday/go-cross-build@v1 + with: + platforms: ${{ matrix.goos }}/${{ matrix.goarch }} + package: 'weed' + name: 'weed' + dest: '/tmp/dist' diff --git a/docker/Dockerfile b/docker/Dockerfile index cf8eac251..d2c365c29 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,7 +8,9 @@ RUN \ elif [ $(uname -m) == "x86_64" ] && [ $(getconf LONG_BIT) == "32" ]; then echo "386"; \ elif [ $(uname -m) == "aarch64" ]; then echo "arm64"; \ elif [ $(uname -m) == "armv7l" ]; then echo "arm"; \ - elif [ $(uname -m) == "armv6l" ]; then echo "arm"; fi;) && \ + elif [ $(uname -m) == "armv6l" ]; then echo "arm"; \ + elif [ $(uname -m) == "s390x" ]; then echo "s390x"; \ + elif [ $(uname -m) == "ppc64le" ]; then echo "ppc64le"; fi;) && \ echo "Building for $ARCH" 1>&2 && \ SUPERCRONIC_SHA1SUM=$(echo $ARCH | sed 's/386/e0126b0102b9f388ecd55714358e3ad60d0cebdb/g' | sed 's/amd64/5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85/g' | sed 's/arm64/e2714c43e7781bf1579c85aa61259245f56dbba1/g' | sed 's/arm/47481c3341bc3a1ae91a728e0cc63c8e6d3791ad/g') && \ SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-$ARCH && \