-
Notifications
You must be signed in to change notification settings - Fork 542
124 lines (114 loc) · 3.89 KB
/
Copy pathdynamic-checks.yml
File metadata and controls
124 lines (114 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Dynamic Analysis Checks
on:
workflow_dispatch: # manually
schedule: # nightly
- cron: "0 2 * * *"
pull_request: # on pull requests touching locking-related files
types:
- opened
- synchronize
- reopened
paths:
- ".github/workflows/dynamic-checks.yml"
- "internal/locking/**"
- "ddtrace/tracer/**"
- "scripts/ci_test_*.sh"
- "**/go.mod"
push:
branches:
- mq-working-branch-**
- release-v*
tags-ignore:
- "contrib/**"
- "instrumentation/**"
- "internal/**"
- "orchestrion/**"
- "scripts/**"
permissions:
id-token: write
contents: read
jobs:
test-with-debug:
name: Dynamic Analysis with Debug Detection
uses: ./.github/workflows/unit-integration-tests.yml
with:
go-version: "1.26.4"
build_tags: "debug"
secrets: inherit
test-with-deadlock:
name: Dynamic Analysis with Deadlock Detection
uses: ./.github/workflows/unit-integration-tests.yml
with:
go-version: "1.26.4"
build_tags: "deadlock"
secrets: inherit
# Test internal/locking specifically with different Go versions and build tags.
test-locking-package:
name: Test internal/locking with Build Tags
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["oldstable", "1.26.4"]
build_tags: ["debug", "debug,deadlock"]
fail-fast: false
env:
BUILD_TAGS: ${{ matrix.build_tags }}
TEST_RESULT_PATH: /tmp/test-results
steps:
- name: Get Datadog credentials
id: dd-sts
continue-on-error: true
uses: DataDog/dd-sts-action@639d841c72f15e4e77747bd726ef8105ce971da2
with:
policy: dd-trace-go
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.ref }}
- name: Setup Go and development tools
uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.go-version }}
tools-dir: ${{ github.workspace }}/_tools
tools-bin: ${{ github.workspace }}/bin
- name: Test internal/locking package
env:
TEST_RESULTS: ${{ env.TEST_RESULT_PATH }}
run: |
export PATH="${{ github.workspace }}/bin:${PATH}"
mkdir -p "$TEST_RESULTS"
cd internal/locking
echo "Testing internal/locking with build tags: $BUILD_TAGS"
TAGS_ARG="-tags="
if [[ -n "$BUILD_TAGS" ]]; then
TAGS_ARG="-tags=$BUILD_TAGS"
fi
gotestsum --junitfile "${TEST_RESULTS}/gotestsum-report-locking-${{ matrix.go-version }}-${{ matrix.build_tags }}.xml" -- ./... -v -race "$TAGS_ARG" -timeout=10m -coverprofile="coverage-locking-${{ matrix.go-version }}-${{ matrix.build_tags }}.txt" -covermode=atomic
- name: Upload test results
if: always()
continue-on-error: true
uses: ./.github/actions/dd-ci-upload
with:
dd-api-key: ${{ steps.dd-sts.outputs.api_key }}
path: ${{ env.TEST_RESULT_PATH }}
tags: go:${{ matrix.go-version }},package:internal/locking,analysis:${{ matrix.build_tags }},arch:${{ runner.arch }},os:${{ runner.os }}
# Summary job to ensure all dynamic checks pass
dynamic-checks-summary:
name: Dynamic Checks Summary
needs:
- test-with-debug
- test-with-deadlock
- test-locking-package
runs-on: ubuntu-latest
if: always()
steps:
- name: Check all jobs succeeded
run: |
if [[ "${{ needs.test-with-debug.result }}" != "success" ]] || \
[[ "${{ needs.test-with-deadlock.result }}" != "success" ]] || \
[[ "${{ needs.test-locking-package.result }}" != "success" ]]; then
echo "One or more dynamic analysis jobs failed"
exit 1
fi
echo "All dynamic analysis checks passed!"