Skip to content

Commit 545103e

Browse files
jupblbampcode-com
andcommitted
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
1 parent 6182c6b commit 545103e

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.github/workflows/scip-examples.yaml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,23 @@ jobs:
1515
timeout-minutes: 30
1616

1717
strategy:
18-
fail-fast: false
18+
fail-fast: false # If a job fails allow others to continue
1919
matrix:
2020
target:
21-
- id: k8s
22-
checkout_repo: kubernetes/kubernetes
21+
- repository: kubernetes/kubernetes
2322
scip_binary: scip-go
24-
- id: guava
25-
checkout_repo: google/guava
23+
- repository: google/guava
2624
scip_binary: scip-java
2725

2826
container: sourcegraph/${{ matrix.target.scip_binary }}:latest
2927
concurrency:
30-
group: index-${{ matrix.target.id }}
28+
group: index-${{ matrix.target.repository }}
3129
cancel-in-progress: true
3230
steps:
33-
- name: Checkout ${{ matrix.target.checkout_repo }}
31+
- name: Checkout ${{ matrix.target.repository }}
3432
uses: actions/checkout@v5
3533
with:
36-
repository: ${{ matrix.target.checkout_repo }}
34+
repository: ${{ matrix.target.repository }}
3735
ref: master
3836
fetch-depth: 1
3937

@@ -42,9 +40,9 @@ jobs:
4240
uses: actions/cache@v4
4341
with:
4442
path: ~/.m2/repository
45-
key: ${{ runner.os }}-maven-${{ matrix.target.id }}-${{ hashFiles('**/pom.xml') }}
43+
key: ${{ runner.os }}-maven-${{ matrix.target.repository }}-${{ github.run_id }}
4644
restore-keys: |
47-
${{ runner.os }}-maven-${{ matrix.target.id }}-
45+
${{ runner.os }}-maven-${{ matrix.target.repository }}-
4846
${{ runner.os }}-maven-
4947
5048
- name: Install Go
@@ -55,7 +53,14 @@ jobs:
5553
- name: Run SCIP
5654
run: |
5755
${{ matrix.target.scip_binary }} --version
58-
${{ matrix.target.scip_binary }} index --verbose
56+
case "${{ matrix.target.scip_binary }}" in
57+
scip-go)
58+
${{ matrix.target.scip_binary }} --verbose
59+
;;
60+
scip-java)
61+
${{ matrix.target.scip_binary }} index --verbose
62+
;;
63+
esac
5964
6065
- name: Validate SCIP index size
6166
run: |
@@ -77,7 +82,7 @@ jobs:
7782
- name: Upload SCIP dump to Sourcegraph
7883
run: |
7984
src code-intel upload -no-progress \
80-
-repo=github.com/${{ matrix.target.checkout_repo }} \
85+
-repo=github.com/${{ matrix.target.repository }} \
8186
-file=index.scip
8287
env:
8388
SRC_ENDPOINT: https://sourcegraph.com/

0 commit comments

Comments
 (0)