52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
name: Test (master)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go_version: [ '1.15', '1.16', '1.17', '1.18' ]
|
|
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 ./...
|
|
|
|
docker-build:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: azure/docker-login@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Set up docker buildx
|
|
id: buildx
|
|
uses: crazy-max/ghaction-docker-buildx@v1
|
|
with:
|
|
buildx-version: latest
|
|
qemu-version: latest
|
|
|
|
- name: Docker buildx available platforms
|
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
|
|
|
- name: Run docker buildx build
|
|
run: |
|
|
docker buildx build \
|
|
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \
|
|
--output=type=registry,push=true \
|
|
--tag ekofr/pihole-exporter:latest \
|
|
.
|