55d5fabbc5
Why do we need this change?
----
Go version 1.12 does not support the %w case which requires go >= 1.13.
This resolves the build tests partially failing since 26ddc36a4e
Additionally as we are upgrading to 1.17 for various things ensure that
we test up to those latest version we support
56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
name: Build/Push (master)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*'
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go_version: [ '1.13', '1.14', '1.15', '1.16', '1.17' ]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: ${{ matrix.go_version }}
|
|
|
|
- name: Install go dependencies
|
|
run: go get -t -v ./...
|
|
|
|
- name: Run go tests
|
|
run: go test -v -cover -race ./...
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: linux
|
|
arch: amd64
|
|
image: scratch
|
|
- os: linux
|
|
arch: arm
|
|
image: arm32v7/alpine:3.13
|
|
- os: linux
|
|
arch: arm64
|
|
image: arm64v8/alpine:3.13
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build and push docker image (${{ matrix.os }}/${{ matrix.arch }})
|
|
uses: docker/build-push-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
repository: ekofr/pihole-exporter
|
|
tags: ${{ matrix.arch }}
|
|
build_args: OS=${{ matrix.os }},ARCH=${{ matrix.arch }},IMAGE=${{ matrix.image }}
|
|
|