diff --git a/.github/workflows/binary_test.yml b/.github/workflows/binary_test.yml new file mode 100644 index 000000000..288abc848 --- /dev/null +++ b/.github/workflows/binary_test.yml @@ -0,0 +1,51 @@ +name: Cross-platform binary build test + +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] + exclude: + - goarch: arm + goos: darwin + - goarch: 386 + goos: darwin + - goarch: arm + goos: windows + - goarch: arm64 + goos: windows + + concurrency: + group: ${{ github.head_ref }}/binary_test/${{ matrix.goos }}/${{ matrix.goarch }} + cancel-in-progress: true + + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + run: | + cd weed; go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + + - name: Build + run: cd weed; GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -v . diff --git a/.github/workflows/container_latest.yml b/.github/workflows/container_latest.yml index b55922df9..6536805db 100644 --- a/.github/workflows/container_latest.yml +++ b/.github/workflows/container_latest.yml @@ -8,6 +8,11 @@ on: jobs: build-latest: runs-on: [ubuntu-latest] + strategy: + matrix: + platform: [ linux ] + arch: [ amd64, arm, arm64, 386 ] + steps: - name: Checkout @@ -55,12 +60,17 @@ jobs: context: ./docker push: ${{ github.event_name != 'pull_request' }} file: ./docker/Dockerfile - platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 + platforms: ${{ matrix.platform }}/${{ matrix.arch }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} build-dev: runs-on: [ubuntu-latest] + strategy: + matrix: + platform: [ linux ] + arch: [ amd64, arm, arm64, 386 ] + steps: - name: Checkout @@ -109,6 +119,6 @@ jobs: context: ./docker push: ${{ github.event_name != 'pull_request' }} file: ./docker/Dockerfile.go_build - platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 + platforms: ${{ matrix.platform }}/${{ matrix.arch }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/.github/workflows/container_release.yml b/.github/workflows/container_release.yml index 1b155b7bd..a0cbbbb68 100644 --- a/.github/workflows/container_release.yml +++ b/.github/workflows/container_release.yml @@ -1,4 +1,5 @@ name: Build Release Containers + on: push: tags: @@ -8,6 +9,11 @@ on: jobs: build-default: runs-on: [ubuntu-latest] + strategy: + matrix: + platform: [ linux ] + arch: [ amd64, arm, arm64, 386 ] + steps: - name: Checkout @@ -58,11 +64,16 @@ jobs: context: ./docker push: ${{ github.event_name != 'pull_request' }} file: ./docker/Dockerfile.go_build - platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 + platforms: ${{ matrix.platform }}/${{ matrix.arch }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} build-large: runs-on: [ubuntu-latest] + strategy: + matrix: + platform: [ linux ] + arch: [ amd64, arm, arm64, 386 ] + steps: - name: Checkout @@ -113,6 +124,6 @@ jobs: context: ./docker push: ${{ github.event_name != 'pull_request' }} file: ./docker/Dockerfile.go_build_large - platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 + platforms: ${{ matrix.platform }}/${{ matrix.arch }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/.github/workflows/container_test.yml b/.github/workflows/container_test.yml index dbb542e54..410d1d21a 100644 --- a/.github/workflows/container_test.yml +++ b/.github/workflows/container_test.yml @@ -1,12 +1,22 @@ name: Test Building Container Images + on: push: pull_request: workflow_dispatch: [] +concurrency: + group: ${{ github.head_ref }}/container_test + cancel-in-progress: true + jobs: build-test: runs-on: [ubuntu-latest] + strategy: + matrix: + platform: [ linux ] + arch: [ amd64, arm, arm64, 386 ] + steps: - name: Checkout @@ -39,6 +49,6 @@ jobs: context: ./docker push: ${{ github.event_name != 'pull_request' }} file: ./docker/Dockerfile - platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 + platforms: ${{ matrix.platform }}/${{ matrix.arch }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b2948a0b7..d6f7bf1b9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ master ] +concurrency: + group: ${{ github.head_ref }}/go + cancel-in-progress: true + jobs: build: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41ac40dc2..e1105e5d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,17 +11,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - goos: [linux, windows, darwin, freebsd, netbsd, openbsd ] + goos: [linux, windows, darwin, freebsd, netbsd, openbsd] goarch: [amd64, arm, arm64, 386] exclude: - goarch: arm goos: darwin - goarch: 386 goos: darwin - - goarch: arm64 - goos: windows - goarch: arm goos: windows + - goarch: arm64 + goos: windows steps: diff --git a/.github/workflows/release_binaries.yml b/.github/workflows/release_binaries.yml index ca3457c8b..9d44209f6 100644 --- a/.github/workflows/release_binaries.yml +++ b/.github/workflows/release_binaries.yml @@ -15,13 +15,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - goos: [linux, windows, darwin, freebsd ] - goarch: [amd64, arm] + goos: [linux, windows, darwin, freebsd, netbsd, openbsd] + goarch: [amd64, arm, arm64, 386] exclude: - goarch: arm goos: darwin + - goarch: 386 + goos: darwin - goarch: arm goos: windows + - goarch: arm64 + goos: windows # Steps represent a sequence of tasks that will be executed as part of the job steps: 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 && \