Skip to content

Commit 005f1ce

Browse files
authored
Gradle to init submodules on test (#289)
* updateSubmodules task/dep in gradle * Remove submodule checkout in workflow to test gradle * Try Windows CI * Use ./ because powershell * Recombine into one with matrix * Accidental commit * Restore "Build" name * Add initSubmodules task, which test{,Python} now depend on instead of dependening on updateSubmodules * git submodule init not enough, depend on updateSubmodules Co-authored-by: eddieh-xlnx <[email protected]>
1 parent d6867cc commit 005f1ce

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616
steps:
1717
- uses: actions/checkout@v2
18-
with:
19-
submodules: recursive
2018

2119
- uses: gradle/[email protected]
2220

build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ abstract class UpdateJarsTask extends DefaultTask {
6868
// Create a task using the task type
6969
tasks.register('update_jars', UpdateJarsTask)
7070

71+
task updateSubmodules(type:Exec) {
72+
group = "build setup"
73+
description = "Update Git submodules"
74+
executable = 'git'
75+
args = ['submodule', 'update', '--init', '--recursive']
76+
}
77+
78+
task initSubmodules {
79+
group = "build setup"
80+
description = "Init Git submodules (first time only)"
81+
if (!file("test/RapidWrightDCP/.git").exists()) {
82+
dependsOn updateSubmodules
83+
}
84+
}
85+
test.dependsOn initSubmodules
86+
7187
task testPython(type:Exec) {
7288
testPython() {
7389
group = "verification"
@@ -81,3 +97,5 @@ task testPython(type:Exec) {
8197
args += ['-p', 'no:faulthandler']
8298
}
8399
test.dependsOn testPython
100+
testPython.dependsOn assemble
101+
testPython.dependsOn initSubmodules

0 commit comments

Comments
 (0)