Skip to content

Commit 251bdc2

Browse files
jupblbampcode-com
andauthored
feat: Upload google/guava and apache/pekko SCIP index (#329)
* Add index-guava job to SCIP examples workflow - Uses scip-java container to index Google Guava repository - Similar to index-k8s job but for Java instead of Go Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-9377a689-7d20-47bd-b80c-ad46731df1b0 * Simplify workflow using matrix strategy - Consolidated two jobs into one with matrix strategy - Removed redundant parameters (upload_repo, container, install_go) - Derive values from scip_binary when possible - Reduced workflow from 112 to ~75 lines Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-9377a689-7d20-47bd-b80c-ad46731df1b0 * Add Maven dependency caching for scip-java Cache Maven artifacts to speed up scip-java runs that download many dependencies Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-9377a689-7d20-47bd-b80c-ad46731df1b0 * Refactor workflow: remove id param, fix Maven cache, handle tool-specific commands - Dropped id parameter, use repository name directly - Renamed checkout_repo to repository - Fixed Maven cache key to avoid hashFiles error - Added case statement to handle scip-go vs scip-java command differences Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-9377a689-7d20-47bd-b80c-ad46731df1b0 * Add more JVM repositories Added `apache/pekko` and `arrow-kt/arrow`. --------- Co-authored-by: Amp <[email protected]>
1 parent c5fe490 commit 251bdc2

File tree

1 file changed

+50
-18
lines changed

1 file changed

+50
-18
lines changed

.github/workflows/scip-examples.yaml

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,62 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
index-k8s:
12+
index:
1313
if: github.repository == 'sourcegraph/scip' # Skip running on forks
1414
runs-on: ubuntu-latest
1515
timeout-minutes: 30
16+
17+
strategy:
18+
fail-fast: false # If a job fails allow others to continue
19+
matrix:
20+
target:
21+
- repository: kubernetes/kubernetes
22+
scip_binary: scip-go
23+
- repository: google/guava
24+
scip_binary: scip-java
25+
# scip-java has problems with indexing Kotlin codebase
26+
# - repository: arrow-kt/arrow
27+
# scip_binary: scip-java
28+
- repository: apache/pekko
29+
scip_binary: scip-java
30+
31+
container: sourcegraph/${{ matrix.target.scip_binary }}:latest
1632
concurrency:
17-
group: index-k8s
33+
group: index-${{ matrix.target.repository }}
1834
cancel-in-progress: true
19-
container: sourcegraph/scip-go:latest
2035
steps:
21-
- name: Checkout kubernetes/kubernetes
36+
- name: Checkout ${{ matrix.target.repository }}
2237
uses: actions/checkout@v5
2338
with:
24-
repository: kubernetes/kubernetes
25-
ref: master
39+
repository: ${{ matrix.target.repository }}
2640
fetch-depth: 1
2741

28-
- name: Configure git safe.directory
29-
run: git config --global --add safe.directory $GITHUB_WORKSPACE
30-
31-
- name: Get src-cli
32-
run: |
33-
curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 \
34-
-o /usr/local/bin/src
35-
chmod +x /usr/local/bin/src
42+
- name: Cache Maven dependencies
43+
if: ${{ matrix.target.scip_binary == 'scip-java' }}
44+
uses: actions/cache@v4
45+
with:
46+
path: ~/.m2/repository
47+
key: ${{ runner.os }}-maven-${{ matrix.target.repository }}-${{ github.run_id }}
48+
restore-keys: |
49+
${{ runner.os }}-maven-${{ matrix.target.repository }}-
50+
${{ runner.os }}-maven-
3651
3752
- name: Install Go
53+
if: ${{ matrix.target.scip_binary == 'scip-go' }}
3854
uses: actions/setup-go@v5
3955
with: { go-version-file: 'go.mod' }
4056

41-
- name: Run scip-go
57+
- name: Run SCIP
4258
run: |
43-
scip-go --version
44-
scip-go --verbose
59+
${{ matrix.target.scip_binary }} --version
60+
case "${{ matrix.target.scip_binary }}" in
61+
scip-go)
62+
${{ matrix.target.scip_binary }} --verbose
63+
;;
64+
scip-java)
65+
${{ matrix.target.scip_binary }} index --verbose
66+
;;
67+
esac
4568
4669
- name: Validate SCIP index size
4770
run: |
@@ -51,10 +74,19 @@ jobs:
5174
fi
5275
echo "SCIP dump size: $(du -h index.scip)"
5376
77+
- name: Configure git safe.directory
78+
run: git config --global --add safe.directory $GITHUB_WORKSPACE
79+
80+
- name: Get src-cli
81+
run: |
82+
curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 \
83+
-o /usr/local/bin/src
84+
chmod +x /usr/local/bin/src
85+
5486
- name: Upload SCIP dump to Sourcegraph
5587
run: |
5688
src code-intel upload -no-progress \
57-
-repo=github.com/kubernetes/kubernetes \
89+
-repo=github.com/${{ matrix.target.repository }} \
5890
-file=index.scip
5991
env:
6092
SRC_ENDPOINT: https://sourcegraph.com/

0 commit comments

Comments
 (0)