Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 11 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false

- uses: DeterminateSystems/magic-nix-cache-action@v13

- name: Build Dockerised CLI
run: nix develop --command bash -c "DOCKER_BUILDKIT=0 sbt cli/docker"
run: docker build -t sourcegraph/scip-java:latest .

- name: Test repos
shell: bash
Expand Down Expand Up @@ -89,8 +83,8 @@ jobs:

- uses: DeterminateSystems/magic-nix-cache-action@v13

- run: nix develop --command sbt build
- run: echo "$PWD/out/bin" >> "$GITHUB_PATH"
- run: nix develop --command sbt cli/pack
- run: echo "$PWD/scip-java/target/pack/bin" >> "$GITHUB_PATH"
- name: Auto-index scip-java codebase
run: |
# shellcheck disable=SC2016
Expand Down Expand Up @@ -129,20 +123,6 @@ jobs:
git diff --exit-code \
scip-kotlinc/minimized/src/generatedSnapshots

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false

- uses: DeterminateSystems/magic-nix-cache-action@v13

- run: nix develop --command sbt --client checkAll


maven:
runs-on: ubuntu-latest
name: Maven tests
Expand All @@ -160,9 +140,14 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@v13

- run: |
nix develop .#jdk${{ matrix.java }} --command sbt build publishM2 publishLocal dumpScipJavaVersion
echo "SCIP_JAVA_VERSION=$(cat VERSION)" >> "$GITHUB_ENV"
echo "SCIP_JAVA_CLI=$PWD/out/bin/scip-java" >> "$GITHUB_ENV"
nix develop .#jdk${{ matrix.java }} --command \
sbt --error cli/pack publishM2 publishLocal
SCIP_JAVA_VERSION="$(
sed -n 's/^version:=//p' scip-java/target/pack/VERSION
)"
test -n "$SCIP_JAVA_VERSION"
printf 'SCIP_JAVA_VERSION=%s\n' "$SCIP_JAVA_VERSION" >> "$GITHUB_ENV"
printf 'SCIP_JAVA_CLI=%s\n' "$PWD/scip-java/target/pack/bin/scip-java" >> "$GITHUB_ENV"

- run: |
nix develop "$GITHUB_WORKSPACE#jdk${{ matrix.java }}" --command \
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,25 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- run: nix develop --command bash -c "DOCKER_BUILDKIT=0 sbt cli/dockerBuildAndPush"
- name: Build and push Docker image
shell: bash
run: |
set -euo pipefail

tags=(--tag sourcegraph/scip-java:latest-snapshot)

if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
version="${GITHUB_REF_NAME#v}"
tags=(
--tag sourcegraph/scip-java:latest
--tag "sourcegraph/scip-java:${version}"
)
fi

docker buildx build --push "${tags[@]}" .
4 changes: 0 additions & 4 deletions .jvmopts

This file was deleted.

15 changes: 0 additions & 15 deletions .scalafix.conf

This file was deleted.

12 changes: 0 additions & 12 deletions .scalafmt.conf

This file was deleted.

7 changes: 2 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ nix develop .#jdk21 # JDK 21
```

This drops you into a shell with `sbt`, `maven`, `gradle`, `bazelisk`,
`scalafmt`, `nodejs`, `yarn`, `git`, `jq`, etc. all pinned to the versions used
in CI.
`nodejs`, `yarn`, `git`, `jq`, etc. all pinned to the versions used in CI.

If you'd rather install tools manually, you'll need at least:

Expand All @@ -40,7 +39,7 @@ These are the main components of the project.
- `tests/snapshots`: slow running
["snapshot tests"](https://jestjs.io/docs/en/snapshot-testing) that index a
corpus of published Java libraries.
- `cli/src/main/scala`: implementation of the `scip-java` command-line
- `scip-java/src/main/kotlin`: implementation of the `scip-java` command-line
interface.
- `build.sbt`: the sbt build definition.
- `project/plugins.sbt`: plugins for the sbt build.
Expand All @@ -59,7 +58,6 @@ These are the main components of the project.
| `scipKotlincMinimized/kotlincSnapshots` | sbt | Update only the Kotlin snapshot goldens under `scip-kotlinc/minimized`. |
| `regenerateSnapshots` | sbt | Regenerate ALL snapshot goldens (Java + Kotlin). Run after fixing a bug. |
| `cli/run --cwd DIRECTORY` | sbt | Run `scip-java` command-line tool against a given Gradle/Maven build. |
| `fixAll` | sbt | Run Scalafmt and Scalafix on all Scala sources. Run this before opening a PR. |
| `google-java-format --replace $(git ls-files '*.java')` | terminal | Format Java sources (from `nix develop`). Enforced by `nix flake check`. |
| `ktfmt --kotlinlang-style $(git ls-files '*.kt')` | terminal | Format Kotlin sources (from `nix develop`). Enforced by `nix flake check`. |

Expand All @@ -74,7 +72,6 @@ community edition is

Next, install the following IntelliJ plugins:

- IntelliJ Scala plugin.
- Google Java Format

Next, follow
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ RUN git config --global --add safe.directory *

COPY . .

RUN sbt publishLocal dumpScipJavaVersion
RUN mkdir -p /app && coursier bootstrap "com.sourcegraph:scip-java:$(cat VERSION)" -f -o /app/scip-java -M com.sourcegraph.scip_java.ScipJava
RUN sbt cli/pack && mkdir -p /app/scip-java && cp -R scip-java/target/pack/. /app/scip-java/

COPY ./bin/scip-java-docker-script.sh /usr/bin/scip-java

Expand Down
2 changes: 1 addition & 1 deletion bin/scip-java-docker-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ do
eval "$(coursier java --jvm "$JVM_VERSION" --env --jvm-index https://github.com/coursier/jvm-index/blob/master/index.json)"

java -version
if /app/scip-java "$@"; then
if /app/scip-java/bin/scip-java "$@"; then
LAST_CODE="0"
else
LAST_CODE=$?
Expand Down
Loading
Loading