Skip to content

Commit 65853b9

Browse files
committed
Add e2e test for rolling back build mode
1 parent 4e5f9c0 commit 65853b9

File tree

2 files changed

+120
-0
lines changed

2 files changed

+120
-0
lines changed

.github/workflows/__build-mode-rollback.yml

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Build mode rollback"
2+
description: "The build mode is rolled back from none to autobuild when the relevant feature flag is enabled."
3+
operatingSystems: ["ubuntu"]
4+
versions: ["nightly-latest"]
5+
env:
6+
CODEQL_ACTION_DISABLE_JAVA_BUILDLESS: true
7+
steps:
8+
- name: Set up Java test repo configuration
9+
run: |
10+
mv * .github ../action/tests/multi-language-repo/
11+
mv ../action/tests/multi-language-repo/.github/workflows .github
12+
mv ../action/tests/java-repo/* .
13+
14+
- uses: ./../action/init
15+
id: init
16+
with:
17+
build-mode: none
18+
db-location: "${{ runner.temp }}/customDbLocation"
19+
languages: java
20+
tools: ${{ steps.prepare-test.outputs.tools-url }}
21+
22+
- name: Validate database build mode
23+
run: |
24+
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
25+
build_mode=$(yq eval '.buildMode' "$metadata_path")
26+
if [[ "$build_mode" != "autobuild" ]]; then
27+
echo "Expected build mode to be 'autobuild' but was $build_mode"
28+
exit 1
29+
fi
30+
31+
- uses: ./../action/analyze

0 commit comments

Comments
 (0)