Fix up Actions (#2)
Reviewed-on: #2 Co-authored-by: Gabriel Simmer <g@gmem.ca> Co-committed-by: Gabriel Simmer <g@gmem.ca>
This commit is contained in:
parent
54d87b724f
commit
15a997cf5b
31
.github/workflows/go.yml
vendored
31
.github/workflows/go.yml
vendored
|
@ -13,18 +13,33 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22'
|
||||
|
||||
- name: install dnsmasq
|
||||
run: apt update && apt install -y dnsmasq
|
||||
|
||||
- name: Ensure all files were formatted as per gofmt
|
||||
run: |
|
||||
[ "$(gofmt -l $(find . -name '*.go') 2>&1)" = "" ]
|
||||
|
||||
- name: install binaries
|
||||
run: go install github.com/google/dnsmasq_exporter
|
||||
- name: run tests
|
||||
run: go test ./... -v -race
|
||||
|
||||
- name: build tests
|
||||
run: go test -c ./collector
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
- name: docker build
|
||||
run: docker build --pull --no-cache --rm -t=dns -f travis/Dockerfile .
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: run tests in docker
|
||||
run: docker run -v $PWD:/usr/src:ro -e TESTDATA_FILE_PATH=/usr/src/collector/testdata/dnsmasq.leases dns /bin/sh -c './collector.test -test.v'
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22'
|
||||
|
||||
- name: build binary
|
||||
run: go build
|
||||
- uses: https://github.com/actions/upload-artifact@v3
|
||||
with:
|
||||
name: dnsmasq_exporter
|
||||
path: dnsmasq_exporter
|
||||
|
|
|
@ -55,9 +55,8 @@ func main() {
|
|||
flag.Parse()
|
||||
|
||||
var (
|
||||
dnsClient = &dns.Client{
|
||||
}
|
||||
cfg = collector.Config{
|
||||
dnsClient = &dns.Client{}
|
||||
cfg = collector.Config{
|
||||
DnsClient: dnsClient,
|
||||
DnsmasqAddr: *dnsmasqAddr,
|
||||
LeasesPath: *leasesPath,
|
||||
|
|
Loading…
Reference in a new issue