Skip to content

Commit

Permalink
chore: make the smoke-test workflow usable as go-libddwaf integ test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainMuller committed Feb 8, 2024
1 parent f0c338a commit c4eae21
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ on:
workflow_call: # allows to reuse this workflow
inputs:
ref:
description: 'The branch to run the workflow on'
description: The branch or tag to run the workflow on
required: true
type: string
go-libddwaf-ref:
description: A git ref to update github.com/DataDog/go-libddwaf/v2 to. No-op if empty.
required: false
type: string
push:
branches:
- main
Expand Down Expand Up @@ -41,9 +45,14 @@ jobs:
go-version: "stable"
cache: true
- name: go get -u
run: |
run: |-
go get -u -t $PACKAGES
go mod tidy
- name: Install requested go-libddwaf version
if: github.event_name == 'workflow_call' && inputs.go-libddwaf-ref != ''
run: |-
go get -u -t github.com/DataDog/go-libddwaf/v2@${{ inputs.go-libddwaf-ref }}
go mod tidy
- name: Compile dd-trace-go
run: go build $PACKAGES
- name: Test dd-trace-go
Expand Down Expand Up @@ -142,5 +151,6 @@ jobs:
build_with_vendoring=${{ matrix.build-with-vendoring }}
build_with_cgo=${{ matrix.build-with-cgo }}
deployment_env=${{ matrix.deployment-env }}
go_libddwaf_ref=${{ inputs.go-libddwaf-ref }}
- name: Test
run: docker run -p7777:7777 --rm smoke-test
6 changes: 6 additions & 0 deletions internal/apps/setup-smoke-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ RUN set -ex; if [ "$build_env" = "alpine" ] && [ "$build_with_cgo" = "1" ]; then
apk update && apk add gcc libc-dev; \
fi

# If requested, upgrade go-libddwaf to the desired release.
ARG go_libddwaf_ref=""
RUN if [ "${go_libddwaf_ref}" != "" ]; then \
go get -u github.com/DataDog/go-libddwaf/v2@${go_libddwaf_ref}; \
fi

RUN go mod tidy

ARG build_with_vendoring
Expand Down

0 comments on commit c4eae21

Please sign in to comment.