Skip to content

Commit

Permalink
build binary in job
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Nov 3, 2024
1 parent 326b430 commit 670dcd4
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 19 deletions.
59 changes: 44 additions & 15 deletions .github/workflows/testing-dnstap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,59 @@ on:
permissions:
contents: read

env:
Q_VERSION: "0.19.2"
PYTHON_VERSION: "3.13"
GO_VERSION: "1.23"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"

- name: Build Binary
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o go-dnscollector *.go
- name: Upload Binary Artifact
uses: actions/upload-artifact@v4
with:
name: go-dnscollector
path: go-dnscollector

unbound:
needs: build
runs-on: ubuntu-latest
env:
COLLECTOR_USER: runneradmin

strategy:
matrix:
go-version: [ '1.23' ]
#go-version: [ '1.23' ]
unbound: [ '1.19.3', '1.20.0' ]

mode: [ 'tcp' ]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
# - uses: actions/setup-go@v5
# with:
# go-version: ${{ matrix.go-version }}
- uses: actions/setup-python@v5
with:
python-version: 3.13
python-version: "${{ env.PYTHON_VERSION }}"

- name: build binary
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o go-dnscollector *.go
- name: Download Binary Artifact
uses: actions/download-artifact@v4
with:
name: go-dnscollector

# - name: build binary
# run: |
# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o go-dnscollector *.go

- name: Deploy docker image
run: |
Expand Down Expand Up @@ -70,7 +98,7 @@ jobs:
go-version: ${{ matrix.go-version }}
- uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: "${{ env.PYTHON_VERSION }}"

- name: build binary
run: |
Expand Down Expand Up @@ -103,7 +131,7 @@ jobs:
go-version: ${{ matrix.go-version }}
- uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: "${{ env.PYTHON_VERSION }}"

- name: build binary
run: |
Expand Down Expand Up @@ -144,12 +172,13 @@ jobs:

steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: "${{ env.PYTHON_VERSION }}"

- name: build binary
run: |
Expand Down Expand Up @@ -186,16 +215,16 @@ jobs:
go-version: ${{ matrix.go-version }}
- uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: "${{ env.PYTHON_VERSION }}"

- name: build binary
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o go-dnscollector *.go
- name: download q
run: |
wget https://github.com/natesales/q/releases/download/v0.19.2/q_0.19.2_linux_amd64.tar.gz
tar xvf q_0.19.2_linux_amd64.tar.gz
wget https://github.com/natesales/q/releases/download/v0.19.2/q_${{ env.Q_VERSION }}_linux_amd64.tar.gz
tar xvf q_${{ env.Q_VERSION }}_linux_amd64.tar.gz
- name: Generate certificate
run: |
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/testing-go.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tests go
name: Go Tests

on:
push:
Expand All @@ -20,6 +20,9 @@ permissions:
env:
PROM_VERSION: "2.55.0"
GENTAP: "0.8.0"
PYTHON_VERSION: '3.13'
GO_VERSION: '1.23'
CHECKOUT_VERSION: "v4"

jobs:
dev:
Expand Down Expand Up @@ -89,7 +92,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.13'
python-version: "${{ env.PYTHON_VERSION }}"

- name: build binary
run: |
Expand All @@ -106,7 +109,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.21', '1.22', '1.23']
go-version: [ '1.21', '1.22', '1.23' ]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -146,10 +149,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure environment to avoid toolchain installs
shell: bash
run: echo "GOTOOLCHAIN=local" >> "$GITHUB_ENV"

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
go-version: ${{ env.GO_VERSION }}

- id: count_tests
run: |
Expand Down

0 comments on commit 670dcd4

Please sign in to comment.