add tests for matching feature + issues fixes #1983
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: go build | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- 'README.md' | |
branches: | |
- main | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- 'README.md' | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
makefile: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: ['1.21', '1.22'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: build binary from makefile | |
run: make build | |
- name: dep from makefile | |
run: make dep | |
- name: dep+build from makefile | |
run: make | |
go-ubuntu: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: ['1.21', '1.22'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: build binary | |
run: | | |
go mod edit -go=${{ matrix.go-version }} | |
go mod tidy | |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o go-dnscollector *.go | |
go-freebsd: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: ['1.21', '1.22'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: build binary | |
run: | | |
go mod edit -go=${{ matrix.go-version }} | |
go mod tidy | |
CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags="-s -w" -o go-dnscollector *.go | |
# for macos and window, limit the build to the latest version | |
go-macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
go-version: ['1.21', '1.22'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: build binary | |
run: | | |
go mod edit -go=${{ matrix.go-version }} | |
go mod tidy | |
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o go-dnscollector *.go | |
go-win: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
go-version: ['1.21', '1.22'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: build binary | |
run: | | |
set CGO_ENABLED=0 | |
go mod edit -go=${{ matrix.go-version }} | |
go mod tidy | |
go build -ldflags="-s -w" -o go-dnscollector.exe . | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the Docker image | |
run: | | |
docker build --build-arg VERSION=dev . --file Dockerfile -t go-dnscollector | |
docker32b: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the Docker image | |
run: | | |
docker build --build-arg VERSION=dev . --platform linux/386 --file Dockerfile -t go-dnscollector |