Skip to content

Commit 9ec7a06

Browse files
authored
Set all directories as "safe" for Git in the indexer docker container (#580)
Also, add Dockerised CLI integration test
1 parent 91241b2 commit 9ec7a06

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
jobs:
88
test:
99
runs-on: ${{ matrix.os }}
10+
name: Tests
1011
strategy:
1112
fail-fast: false
1213
matrix:
@@ -22,6 +23,33 @@ jobs:
2223
cache: "sbt"
2324
java-version: ${{ matrix.java }}
2425
- run: sbt test
26+
27+
docker_test:
28+
runs-on: ${{ matrix.os }}
29+
name: Docker CLI tests
30+
strategy:
31+
fail-fast: true
32+
matrix:
33+
os: [ubuntu-latest]
34+
steps:
35+
- uses: actions/checkout@v2
36+
37+
- uses: actions/setup-java@v3
38+
with:
39+
distribution: "temurin"
40+
cache: "sbt"
41+
java-version: 17
42+
43+
- name: Build Dockerised CLI
44+
run: sbt cli/docker
45+
46+
- run: |
47+
git clone https://github.com/circe/circe.git
48+
49+
docker run -v $PWD:/sources -w /sources sourcegraph/scip-java:latest scip-java index --cwd circe
50+
file circe/index.scip || (echo "circe SCIP index doesn't exist!"; exit 1)
51+
52+
2553
bazel:
2654
runs-on: ubuntu-latest
2755
steps:
@@ -36,6 +64,7 @@ jobs:
3664
working-directory: examples/bazel-example
3765
- run: du -h index.scip
3866
working-directory: examples/bazel-example
67+
3968
check:
4069
runs-on: ubuntu-latest
4170
steps:
@@ -45,4 +74,4 @@ jobs:
4574
distribution: "temurin"
4675
java-version: 17
4776
cache: "sbt"
48-
- run: sbt checkAll cli/docker
77+
- run: sbt checkAll

build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ lazy val cli = project
271271
env("PATH", "/opt/maven/bin:${PATH}")
272272
env("PATH", "/root/.local/share/coursier/bin:${PATH}")
273273

274+
// Mark all directories as safe for Git, so that it doesn't
275+
// trigger this check and error:
276+
// `detected dubious ownership in repository at <folder>`
277+
run("git", "config", "--global", "--add", "safe.directory", "*")
278+
274279
// Install `scip-java` binary.
275280
add(scipJavaWrapper, "/usr/local/bin/scip-java")
276281
add(binaryDistribution, "/app/scip-java")

0 commit comments

Comments
 (0)