pihole-exporter/.github/workflows/master.yml

53 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2021-10-12 11:48:41 +02:00
name: Test (master)
on:
push:
branches:
- master
jobs:
2020-05-05 08:47:24 +02:00
test:
runs-on: ubuntu-latest
2020-05-05 08:47:24 +02:00
strategy:
matrix:
2023-03-02 20:44:38 +01:00
go_version: [ '1.20' ]
steps:
2023-03-02 20:44:38 +01:00
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
2020-05-05 08:47:24 +02:00
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:
2023-03-02 20:44:38 +01:00
- uses: actions/checkout@v3
- 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 \
.