-
Notifications
You must be signed in to change notification settings - Fork 44
182 lines (144 loc) · 5.61 KB
/
ci.yml
File metadata and controls
182 lines (144 loc) · 5.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
name: Tests
strategy:
fail-fast: false
matrix:
java: [11, 17, 21]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- name: Main project tests
run: nix develop .#jdk${{ matrix.java }} --command sbt test
docker_test:
runs-on: ubuntu-latest
name: Docker CLI tests
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"
- name: Test repos
shell: bash
run: |
set -eu
check_repo() {
REPO=$1
mkdir -p ".repos/$REPO"
git clone "https://github.com/$REPO.git" ".repos/$REPO" && cd ".repos/$REPO" && git submodule update --init
docker run -v "$PWD/.repos/$REPO:/sources" -w /sources sourcegraph/scip-java:latest scip-java index
file ".repos/$REPO/index.scip" || (echo "$REPO SCIP index doesn't exist!"; exit 1)
}
sudo apt install parallel
export -f check_repo
parallel -j4 check_repo ::: circe/circe indeedeng/iwf-java-sdk
bazel:
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 bazelisk build //... --//semanticdb-javac:enabled=true
- run: nix develop --command bazelisk run scip-semanticdb:bazel -- --sourceroot "$PWD"
- run: du -h index.scip
- run: nix develop "$GITHUB_WORKSPACE" --command bazelisk build //... --@scip_java//semanticdb-javac:enabled=true
working-directory: examples/bazel-example
- run: nix develop "$GITHUB_WORKSPACE" --command bazelisk run @scip_java//scip-semanticdb:bazel -- --sourceroot "$PWD"
working-directory: examples/bazel-example
- run: du -h index.scip
working-directory: examples/bazel-example
bazel_aspect:
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 build
- run: echo "$PWD/out/bin" >> "$GITHUB_PATH"
- name: Auto-index scip-java codebase
run: |
# shellcheck disable=SC2016
nix develop --command bash -c \
'scip-java index --build-tool=bazel --bazel-scip-java-binary=$(which scip-java)'
- run: du -h index.scip
- name: Auto-index example/bazel-workspace
run: |
# shellcheck disable=SC2016
nix develop "$GITHUB_WORKSPACE" --command bash -c \
'scip-java index --build-tool=bazel --bazel-scip-java-binary=$(which scip-java)'
working-directory: examples/bazel-example
- run: du -h index.scip
working-directory: examples/bazel-example
kotlin_plugin:
runs-on: ubuntu-latest
name: semanticdb-kotlinc
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- name: semanticdb-kotlinc tests
run: nix develop --command sbt semanticdbKotlinc/test
- name: Kotlin snapshots
run: nix develop --command sbt semanticdbKotlincMinimized/kotlincSnapshots
- name: Check snapshot drift
run: |
git diff --exit-code \
semanticdb-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
strategy:
fail-fast: false
matrix:
java: [11, 17, 21]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- 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"
- run: |
nix develop "$GITHUB_WORKSPACE#jdk${{ matrix.java }}" --command \
mvn clean verify -DskipTests "-Dscip-java.version=$SCIP_JAVA_VERSION" sourcegraph:sourcegraphDependencies
working-directory: examples/maven-example
- run: nix develop "$GITHUB_WORKSPACE#jdk${{ matrix.java }}" --command "$SCIP_JAVA_CLI" index-semanticdb target/semanticdb-targetroot
working-directory: examples/maven-example
- run: |
set -e
grep org.hamcrest target/semanticdb-targetroot/*dependencies.txt
grep "$PWD/src/main/java" target/semanticdb-targetroot/*dependencies.txt
working-directory: examples/maven-example
- run: du -h index.scip
working-directory: examples/maven-example