Skip to content

Update module github.com/scip-code/scip/bindings/go/scip to v0.8.0 #128

Update module github.com/scip-code/scip/bindings/go/scip to v0.8.0

Update module github.com/scip-code/scip/bindings/go/scip to v0.8.0 #128

Workflow file for this run

name: test
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v14
- run: nix flake check
- run: nix build .#scip-go
- name: Upload scip-go binary
uses: actions/upload-artifact@v7
with:
name: scip-go
path: result/bin/scip-go
docker:
strategy:
matrix:
include:
- runner: ubuntu-latest
- runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v14
- run: nix build .#docker
- name: Index scip-go with docker image
run: |
image=$(docker load -i result | sed -n 's/Loaded image: //p')
echo "Loaded $image"
docker run --rm \
-v "$GITHUB_WORKSPACE:/work" \
"$image" \
scip-go -o /work/index.scip
size=$(stat --format='%s' index.scip)
echo "Index size: $size bytes"
[ "$size" -ge 1024 ] || { echo "FAIL: index too small"; exit 1; }
index:
needs: [build]
strategy:
matrix:
include:
- name: scip-go
repo: scip-code/scip-go
ref: ${{ github.sha }}
expect_file: "cmd/scip-go/main.go"
- name: kubernetes
repo: kubernetes/kubernetes
ref: v1.32.3
expect_file: "pkg/apis/core/validation/validation.go"
- name: caddy
repo: caddyserver/caddy
ref: v2.9.1
expect_file: "caddy.go"
- name: syncthing
repo: syncthing/syncthing
ref: v1.29.2
expect_file: "lib/protocol/protocol.go"
- name: bazel-gazelle
repo: bazelbuild/bazel-gazelle
ref: v0.50.0
expect_file: "cmd/gazelle/main.go"
gopackagesdriver: true
- name: prometheus
repo: prometheus/prometheus
ref: v3.0.1
expect_file: "cmd/prometheus/main.go"
- name: hugo
repo: gohugoio/hugo
ref: v0.143.1
expect_file: "main.go"
- name: tailscale
repo: tailscale/tailscale
ref: v1.78.1
expect_file: "cmd/tailscale/cli/cli.go"
- name: klauspost-compress
repo: klauspost/compress
ref: v1.18.0
expect_file: "s2/encode.go"
runs-on: ubuntu-latest
name: ${{ matrix.name }}
timeout-minutes: 120
steps:
- name: Download scip-go binary
uses: actions/download-artifact@v8
with:
name: scip-go
path: scip-go-bin
- name: Download scip CLI
run: |
curl -fsSL https://github.com/scip-code/scip/releases/latest/download/scip-linux-amd64.tar.gz \
| tar -xz -C /usr/local/bin scip
- name: Install scip-go
run: |
chmod +x scip-go-bin/scip-go
echo "$GITHUB_WORKSPACE/scip-go-bin" >> "$GITHUB_PATH"
- name: Checkout target repo
uses: actions/checkout@v6
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: target
- uses: actions/setup-go@v6
with:
go-version: stable
cache-dependency-path: target/go.sum
- name: Set up GOPACKAGESDRIVER
if: matrix.gopackagesdriver
working-directory: target
run: |
driver="$GITHUB_WORKSPACE/gopackagesdriver.sh"
cat > "$driver" <<'DRIVER'
#!/usr/bin/env bash
exec bazel run --tool_tag=gopackagesdriver \
@io_bazel_rules_go//go/tools/gopackagesdriver -- "$@"
DRIVER
chmod +x "$driver"
echo "GOPACKAGESDRIVER=$driver" >> "$GITHUB_ENV"
- name: Run scip-go
working-directory: target
run: |
/usr/bin/time -v -o "$GITHUB_WORKSPACE/metrics.txt" \
scip-go -o "$GITHUB_WORKSPACE/index.scip" -VV
- name: Validate index
working-directory: target
run: |
size=$(stat --format='%s' "$GITHUB_WORKSPACE/index.scip")
echo "Index size: $size bytes"
[ "$size" -ge 1024 ] || { echo "FAIL: index too small"; exit 1; }
scip stats --from "$GITHUB_WORKSPACE/index.scip" --project-root . \
| jq -e '.documents > 0 and .occurrences > 0 and .definitions > 0'
scip print --json "$GITHUB_WORKSPACE/index.scip" \
| jq -e --arg f "${{ matrix.expect_file }}" \
'any(.documents[]; .relative_path == $f)'
- name: Report resource usage
run: |
{
echo "### scip-go: ${{ matrix.name }}"
echo '```'
grep -E 'Maximum resident|User time|System time|Percent of CPU' \
"$GITHUB_WORKSPACE/metrics.txt"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
fingerprint-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: stable
cache-dependency-path: go.sum
- run: ./internal/implementations/fingerprint/sync.sh
- run: git diff --exit-code internal/implementations/fingerprint/fingerprint.go
ci-test:
if: always()
needs: [build, docker, index, fingerprint-sync]
runs-on: ubuntu-latest
steps:
- if: >-
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
run: exit 1