Skip to content

Commit dd84f73

Browse files
committed
Add autobuild workind-directory test
1 parent b0c570e commit dd84f73

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

.github/workflows/__test-autobuild-working-dir.yml

+68
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Autobuild working directory"
2+
description: "Tests working-directory input of autobuild action"
3+
versions: ["latest"]
4+
os: ["ubuntu-latest"]
5+
steps:
6+
- name: Test setup
7+
shell: bash
8+
run: |
9+
mkdir autobuild-dir
10+
mv *.go autobuild-dir
11+
# The invalid go.mod breaks Go autobuild in default directory
12+
touch go.mod
13+
- uses: ./../action/init
14+
with:
15+
languages: go
16+
tools: ${{ steps.prepare-test.outputs.tools-url }}
17+
- uses: ./../action/autobuild
18+
with:
19+
working-directory: autobuild-dir
20+
- uses: ./../action/analyze
21+
id: analysis
22+
env:
23+
TEST_MODE: true
24+
- name: Check database
25+
shell: bash
26+
run: |
27+
GO_DB="${{ fromJson(steps.analysis.outputs.db-locations).go }}"
28+
if [[ ! -d "$GO_DB" ]]; then
29+
echo "Did not create a database."
30+
exit 1
31+
fi

0 commit comments

Comments
 (0)