Skip to content

Commit

Permalink
code factory in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Nov 3, 2024
1 parent e99041d commit a5123f6
Showing 1 changed file with 54 additions and 53 deletions.
107 changes: 54 additions & 53 deletions .github/workflows/testing-dnstap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,14 @@ jobs:
unbound:
needs: build
runs-on: ubuntu-latest
env:
COLLECTOR_USER: runneradmin

strategy:
matrix:
#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-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"
Expand All @@ -66,16 +60,9 @@ jobs:
uses: actions/download-artifact@v4
with:
name: go-dnscollector
- name: Display structure of downloaded files
run: ls -R

- name: Make Binary Executable
run: chmod +x go-dnscollector
- name: Display structure of downloaded files
run: ls -R

# - 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 All @@ -91,26 +78,28 @@ jobs:
python3 -m unittest tests.dnsquery_dnstap${{ matrix.mode }} -v
coredns:
needs: build
runs-on: ubuntu-latest

strategy:
matrix:
go-version: [ '1.23' ]
coredns: [ '1.10.1', '1.11.1' ]
mode: [ 'tcp' ]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- uses: actions/setup-python@v5
with:
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: Make Binary Executable
run: chmod +x go-dnscollector

- name: Deploy coredns docker image
run: |
Expand All @@ -119,31 +108,35 @@ jobs:
- name: Test ${{ matrix.mode }}
run: |
sudo python3 -m pip install dnstap_pb fstrm dnspython
sudo python3 -m pip install --upgrade protobuf
sudo python3 -m unittest tests.dnsquery_dnstap${{ matrix.mode }} -v
python3 -m venv venv
source venv/bin/activate
python3 -m pip install dnstap_pb fstrm dnspython
python3 -m pip install --upgrade protobuf
python3 -m unittest tests.dnsquery_dnstap${{ matrix.mode }} -v
coredns_tls:
needs: build
runs-on: ubuntu-latest

strategy:
matrix:
go-version: [ '1.23' ]
coredns: [ '1.11.1' ]
mode: [ 'tls' ]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- uses: actions/setup-python@v5
with:
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: Make Binary Executable
run: chmod +x go-dnscollector

- name: Generate certificate
run: |
Expand All @@ -162,36 +155,38 @@ jobs:
- name: Test ${{ matrix.mode }}
run: |
sudo python3 -m pip install dnstap_pb fstrm dnspython
sudo python3 -m pip install --upgrade protobuf
sudo python3 -m unittest tests.dnsquery_dnstap${{ matrix.mode }} -v
python3 -m venv venv
source venv/bin/activate
python3 -m pip install dnstap_pb fstrm dnspython
python3 -m pip install --upgrade protobuf
python3 -m unittest tests.dnsquery_dnstap${{ matrix.mode }} -v
dnsdist:
needs: build
runs-on: ubuntu-latest
env:
COLLECTOR_USER: pdns

strategy:
matrix:
go-version: [ '1.23' ]
dnsdist: [ '17', '18', '19' ]

mode: [ 'dnstaptcp', 'dnstapunix' ]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/setup-python@v5
with:
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: Make Binary Executable
run: chmod +x go-dnscollector

- name: add pdns user
run: |
sudo addgroup --system --gid 953 pdns
Expand All @@ -204,30 +199,34 @@ jobs:
- name: Test ${{ matrix.mode }}
run: |
sudo python3 -m pip install dnstap_pb fstrm dnspython
sudo python3 -m pip install --upgrade protobuf
python3 -m venv venv
source venv/bin/activate
python3 -m pip install dnstap_pb fstrm dnspython
python3 -m pip install --upgrade protobuf
sudo -E python3 -m unittest tests.dnsquery_${{ matrix.mode }} -v
dnsdist_doq:
needs: build
runs-on: ubuntu-latest

strategy:
matrix:
go-version: [ '1.23' ]
dnsdist: [ '19' ]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- uses: actions/setup-python@v5
with:
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: Make Binary Executable
run: chmod +x go-dnscollector

- name: download q
run: |
Expand All @@ -250,4 +249,6 @@ jobs:
- name: Tests
run: |
sudo python3 -m unittest tests.dnsquery_dnstapdoq -v
python3 -m venv venv
source venv/bin/activate
python3 -m unittest tests.dnsquery_dnstapdoq -v

0 comments on commit a5123f6

Please sign in to comment.