2021-10-12 11:48:41 +02:00
|
|
|
name: Test (master)
|
2020-04-04 06:34:00 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-05-05 13:32:37 +02:00
|
|
|
branches:
|
2022-06-06 22:05:54 +02:00
|
|
|
- master
|
2020-04-04 06:34:00 +02:00
|
|
|
|
|
|
|
jobs:
|
2020-05-05 08:47:24 +02:00
|
|
|
test:
|
2020-04-04 06:34:00 +02:00
|
|
|
runs-on: ubuntu-latest
|
2020-05-05 08:47:24 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-06-06 22:05:54 +02:00
|
|
|
go_version: [ '1.15', '1.16', '1.17', '1.18' ]
|
2020-04-04 06:34:00 +02:00
|
|
|
steps:
|
2020-05-05 08:47:24 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go_version }}
|
2020-05-05 13:32:37 +02:00
|
|
|
|
|
|
|
- name: Install go dependencies
|
|
|
|
run: go get -t -v ./...
|
|
|
|
|
|
|
|
- name: Run go tests
|
|
|
|
run: go test -v -cover -race ./...
|
2020-05-04 21:02:27 +02:00
|
|
|
|
2022-06-06 22:05:54 +02:00
|
|
|
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 \
|
|
|
|
.
|