8000 Enable all CI tests · Arthurm1/scip-java@61041d8 · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit 61041d8

Browse files
committed
Enable all CI tests
1 parent 8f0be2e commit 61041d8

File tree

2 files changed

+78
-72
lines changed

2 files changed

+78
-72
lines changed

.github/workflows/ci.yml

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -5,76 +5,76 @@ on:
55
- main
66
pull_request:
77
jobs:
8-
# test:
9-
# runs-on: ${{ matrix.os }}
10-
# name: Tests
11-
# strategy:
12-
# fail-fast: false
13-
# matrix:
14-
# # NOTE(olafurpg) Windows is not enabled because it times out due to reasons I don't understand.
15-
# # os: [windows-latest, ubuntu-latest]
16-
# os: [ubuntu-latest]
17-
# java: [8, 11, 17]
18-
# steps:
19-
# - uses: actions/checkout@v2
20-
# - uses: actions/setup-java@v3
21-
# with:
22-
# distribution: "temurin"
23-
# cache: "sbt"
24-
# java-version: ${{ matrix.java }}
25-
# - name: Main project tests
26-
# run: sbt test
8+
test:
9+
runs-on: ${{ matrix.os }}
10+
name: Tests
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
# NOTE(olafurpg) Windows is not enabled because it times out due to reasons I don't understand.
15+
# os: [windows-latest, ubuntu-latest]
16+
os: [ubuntu-latest]
17+
java: [8, 11, 17]
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-java@v3
21+
with:
22+
distribution: "temurin"
23+
cache: "sbt"
24+
java-version: ${{ matrix.java }}
25+
- name: Main project tests
26+
run: sbt test
2727

28-
# docker_test:
29-
# runs-on: ${{ matrix.os }}
30-
# name: Docker CLI tests
31-
# strategy:
32-
# fail-fast: true
33-
# matrix:
34-
# os: [ubuntu-latest]
35-
# steps:
36-
# - uses: actions/checkout@v2
28+
docker_test:
29+
runs-on: ${{ matrix.os }}
30+
name: Docker CLI tests
31+
strategy:
32+
fail-fast: true
33+
matrix:
34+
os: [ubuntu-latest]
35+
steps:
36+
- uses: actions/checkout@v2
3737

38-
# - uses: actions/setup-java@v3
39-
# with:
40-
# distribution: "temurin"
41-
# cache: "sbt"
42-
# java-version: 17
38+
- uses: actions/setup-java@v3
39+
with:
40+
distribution: "temurin"
41+
cache: "sbt"
42+
java-version: 17
4343

44-
# - name: Build Dockerised CLI
45-
# run: sbt cli/docker
44+
- name: Build Dockerised CLI
45+
run: sbt cli/docker
4646

47-
# - run: |
47+
- run: |
4848
49-
# set -eu
50-
# check_repo() {
51-
# REPO=$1
52-
# mkdir -p .repos/$REPO
53-
# git clone https://github.com/$REPO.git .repos/$REPO
49+
set -eu
50+
check_repo() {
51+
REPO=$1
52+
mkdir -p .repos/$REPO
53+
git clone https://github.com/$REPO.git .repos/$REPO
5454
55-
# docker run -v $PWD/.repos/$REPO:/sources -w /sources sourcegraph/scip-java:latest scip-java index
56-
# file .repos/$REPO/index.scip || (echo "$REPO SCIP index doesn't exist!"; exit 1)
57-
# }
55+
docker run -v $PWD/.repos/$REPO:/sources -w /sources sourcegraph/scip-java:latest scip-java index
56+
file .repos/$REPO/index.scip || (echo "$REPO SCIP index doesn't exist!"; exit 1)
57+
}
5858
59-
# sudo apt install parallel
60-
# export -f check_repo
59+
sudo apt install parallel
60+
export -f check_repo
6161
62-
# parallel -j4 check_repo ::: circe/circe indeedeng/iwf-java-sdk
62+
parallel -j4 check_repo ::: circe/circe indeedeng/iwf-java-sdk
6363
64-
# bazel:
65-
# runs-on: ubuntu-latest
66-
# steps:
67-
# - uses: actions/checkout@v2
68-
# - run: yarn global add @bazel/bazelisk
69-
# - run: bazel build //... --//semanticdb-javac:enabled=true
70-
# - run: bazel run scip-semanticdb:bazel -- --sourceroot "$PWD"
71-
# - run: du -h index.scip
72-
# - run: bazel build //... --@scip_java//semanticdb-javac:enabled=true
73-
# working-directory: examples/bazel-example
74-
# - run: bazel run @scip_java//scip-semanticdb:bazel -- --sourceroot "$PWD"
75-
# w A3E2 orking-directory: examples/bazel-example
76-
# - run: du -h index.scip
77-
# working-directory: examples/bazel-example
64+
bazel:
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v2
68+
- run: yarn global add @bazel/bazelisk
69+
- run: bazel build //... --//semanticdb-javac:enabled=true
70+
- run: bazel run scip-semanticdb:bazel -- --sourceroot "$PWD"
71+
- run: du -h index.scip
72+
- run: bazel build //... --@scip_java//semanticdb-javac:enabled=true
73+
working-directory: examples/bazel-example
74+
- run: bazel run @scip_java//scip-semanticdb:bazel -- --sourceroot "$PWD"
75+
working-directory: examples/bazel-example
76+
- run: du -h index.scip
77+
working-directory: examples/bazel-example
7878

7979
bazel_aspect:
8080
runs-on: ubuntu-latest
@@ -89,13 +89,13 @@ jobs:
8989
- run: du -h index.scip
9090
working-directory: examples/bazel-example
9191

92-
# check:
93-
# runs-on: ubuntu-latest
94-
# steps:
95-
# - uses: actions/checkout@v2
96-
# - uses: actions/setup-java@v3
97-
# with:
98-
# distribution: "temurin"
99-
# java-version: 17
100-
# cache: "sbt"
101-
# - run: sbt checkAll
92+
check:
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v2
96+
- uses: actions/setup-java@v3
97+
with:
98+
distribution: "temurin"
99+
java-version: 17
100+
cache: "sbt"
101+
- run: sbt checkAll

scip-java/src/main/resources/scip-java/scip_java.bzl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ many *.scip (https://github.com/sourcegraph/scip) and
1414
These files encode information about which symbols are referenced from which
1515
locations in your source code.
1616
17+
This aspect only works on Linux when using the `local` spawn strategy because
18+
the `run_shell` action writes SemanticDB and SCIP files to the provided
19+
--targetroot argument. It should be possible to avoid this requirement
20+
in the future if there's a strong desire to make the aspect work with the
21+
default (sandboxed) spawn strategy.
22+
1723
Use the command below to merge all of these SCIP files into a single index:
1824
1925
find bazel-bin/ -type f -name '*.scip' | xargs cat > index.scip
@@ -28,7 +34,7 @@ Use `src code-intel upload` to upload the unified SCIP file to Sourcegraph:
2834
2935
Example command to run this aspect directly:
3036
31-
bazel build //... --aspects path/to/scip_java.bzl%scip_java_aspect --output_groups=scip --define=sourceroot=$(pwd) --define=scip_java_binary=$(which scip-java) --define=java_home=$JAVA_HOME
37+
bazel build //... --spawn_strategy=local --aspects path/to/scip_java.bzl%scip_java_aspect --output_groups=scip --define=sourceroot=$(pwd) --define=scip_java_binary=$(which scip-java) --define=java_home=$JAVA_HOME
3238
3339
To learn more about aspects: https://bazel.build/extending/aspects
3440
"""

0 commit comments

Comments
 (0)
0