Skip to content

Commit 1d311fe

Browse files
committed
Add PR checks for reconciled tracing with autobuilder and build steps
1 parent e303e2c commit 1d311fe

4 files changed

Lines changed: 265 additions & 0 deletions

File tree

.github/workflows/__go-reconciled-tracing-autobuilder.yml

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-reconciled-tracing-custom-build-steps.yml

Lines changed: 109 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Go: Reconciled tracing with autobuilder"
2+
description: "Checks that Go reconciled tracing works when using an autobuilder step"
3+
os: ["ubuntu-latest", "macos-latest"]
4+
env:
5+
CODEQL_ACTION_RECONCILE_GO_EXTRACTION: "true"
6+
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
7+
steps:
8+
- uses: actions/setup-go@v3
9+
with:
10+
go-version: "^1.13.1"
11+
- uses: ./../action/init
12+
with:
13+
languages: go
14+
tools: ${{ steps.prepare-test.outputs.tools-url }}
15+
env:
16+
TEST_MODE: true
17+
- uses: ./../action/autobuild
18+
- uses: ./../action/analyze
19+
env:
20+
TEST_MODE: true
21+
- shell: bash
22+
run: |
23+
if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then
24+
echo "Expected the Go autobuilder to be run, but the" \
25+
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was not true."
26+
exit 1
27+
fi
28+
cd "$RUNNER_TEMP/codeql_databases"
29+
if [[ ! -d go ]]; then
30+
echo "Did not find a Go database"
31+
exit 1
32+
fi
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Go: Reconciled tracing with custom build steps"
2+
description: "Checks that reconciled Go tracing traces the build when using custom build steps"
3+
env:
4+
# Enable reconciled Go tracing beta functionality
5+
CODEQL_ACTION_RECONCILE_GO_EXTRACTION: "true"
6+
steps:
7+
- uses: actions/setup-go@v3
8+
with:
9+
go-version: "^1.13.1"
10+
- uses: ./../action/init
11+
with:
12+
languages: go
13+
tools: ${{ steps.prepare-test.outputs.tools-url }}
14+
env:
15+
TEST_MODE: true
16+
- name: Build code
17+
shell: bash
18+
run: go build main.go
19+
- uses: ./../action/analyze
20+
env:
21+
TEST_MODE: true
22+
- shell: bash
23+
run: |
24+
if [[ -v CODEQL_ACTION_DID_AUTOBUILD_GOLANG ]]; then
25+
echo "Expected the Go autobuilder not to be run, but the" \
26+
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
27+
exit 1
28+
fi
29+
cd "$RUNNER_TEMP/codeql_databases"
30+
if [[ ! -d go ]]; then
31+
echo "Did not find a Go database"
32+
exit 1
33+
fi

0 commit comments

Comments
 (0)