Skip to content

Commit 2c8b4be

Browse files
authored
Merge pull request #379 from ghostbuster91/setup-sourcegraph-scala2
Setup sourcegraph for scala 2
2 parents 9b3e5db + 9d5aa3d commit 2c8b4be

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

.github/workflows/main.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@v2
1818
- name: Set up JDK 11
19-
uses: actions/setup-java@v1
19+
uses: coursier/setup-action@v1.1.2
2020
with:
21-
java-version: 11
21+
jvm: adopt:11
2222
- name: Cache sbt
2323
uses: coursier/cache-action@v6
2424
with:
@@ -40,16 +40,44 @@ jobs:
4040
with:
4141
fetch-depth: 0 # checkout tags so that dynver works properly (we need the version for MiMa)
4242
- name: Set up JDK 11
43-
uses: actions/setup-java@v1
43+
uses: coursier/setup-action@v1.1.2
4444
with:
45-
java-version: 11
45+
jvm: adopt:11
4646
- name: Cache sbt
4747
uses: coursier/cache-action@v6
4848
with:
4949
extraKey: sbt-cache-${{ runner.os }}
5050
- name: Check MiMa # disable for major releases
5151
run: sbt -v core/mimaReportBinaryIssues
5252

53+
sourcegraph:
54+
name: Upload index to sourcegraph
55+
needs: [ci]
56+
# run on external PRs, but not on internal PRs since those will be run by push to branch
57+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
58+
runs-on: ubuntu-20.04
59+
env:
60+
JAVA_OPTS: -Xmx4G
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v2
64+
- name: Set up JDK 11
65+
uses: coursier/setup-action@v1.1.2
66+
with:
67+
jvm: adopt:11
68+
- name: Cache sbt
69+
uses: coursier/cache-action@v6
70+
with:
71+
extraKey: sbt-cache-${{ runner.os }}
72+
- name: Generate LSIF
73+
run: sbt 'set every semanticdbEnabled := true; set every semanticdbVersion := "4.4.33"' sourcegraphLsif
74+
- name: Upload LSIF data
75+
uses: sourcegraph/lsif-upload-action@master
76+
with:
77+
endpoint: https://sourcegraph.com
78+
github_token: ${{ secrets.GITHUB_TOKEN }}
79+
file: target/sbt-sourcegraph/dump.lsif
80+
5381
publish:
5482
name: Publish release
5583
needs: [ci]
@@ -61,9 +89,9 @@ jobs:
6189
- name: Checkout
6290
uses: actions/checkout@v2
6391
- name: Set up JDK 11
64-
uses: actions/setup-java@v1
92+
uses: coursier/setup-action@v1.1.2
6593
with:
66-
java-version: 11
94+
jvm: adopt:11
6795
- name: Cache sbt
6896
uses: coursier/cache-action@v6
6997
with:

project/plugins.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" %
77
addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1")
88
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.8.0")
99
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1")
10+
11+
addSbtPlugin("com.sourcegraph" % "sbt-sourcegraph" % "0.3.3")

0 commit comments

Comments
 (0)