From 653296687fb4306f08dad4f1df953ae9e8116e28 Mon Sep 17 00:00:00 2001 From: till Date: Sun, 21 Feb 2021 21:59:19 +0100 Subject: [PATCH] Chore: move integrations tests to actions --- .github/workflows/pr.yml | 27 +++++++++++++++++++++++++++ .goreleaser.yml | 5 +---- README.md | 7 +++---- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d195a6d..71d5c62 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -45,3 +45,30 @@ jobs: with: name: dnsbl_exporter path: dist/dnsbl_exporter_linux_amd64 + + integration: + runs-on: ubuntu-latest + needs: + - snapshot + services: + unbound: + image: klutchell/unbound:latest + ports: + - 5053:5053 + - 5053:5053/udp + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: dnsbl_exporter + - name: Allow running exporter + run: chmod +x ./dnsbl-exporter + - name: Start dnsbl_exporter + run: ./dnsbl-exporter --config.dns-resolver=unbound:5053 & + working-directory: ./dnsbl_exporter + - name: Test "/" exists + run: curl -I http://127.0.0.1:9211/ + - name: Test "/metrics" exists + run: curl -I http://127.0.0.1:9211/metrics + - name: Test "/metrics" with targets + run: curl -i http://127.0.0.1:9211/metrics diff --git a/.goreleaser.yml b/.goreleaser.yml index d92c479..80795ae 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,12 +1,9 @@ -# This is an example goreleaser.yaml file with some sane defaults. -# Make sure to check the documentation at http://goreleaser.com +--- project_name: dnsbl_exporter before: hooks: - # you may remove this if you don't use vgo - go mod tidy - # you may remove this if you don't need go generate - go generate ./... builds: - main: ./dnsbl_exporter.go diff --git a/README.md b/README.md index ca2f1e1..a4e3434 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,6 @@ $ sudo unbound -d -vvvv (This is for myself, since I tend to forget things.) - 1. Create a release on Github - 1. Assemble changelog based on PR merges, etc. - 1. Tag must be `v1.0.0` (semantic versioning, prefixed by `v`) - 1. CircleCI will pick it up and build the binaries + 1. `git tag -a x.y.z` + 1. `git push --tags` + 1. GitHub Actions/GoReleaser will build a pretty release