SCIP index uploading #45
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SCIP index uploading | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Run every day at midnight UTC | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: read | |
| jobs: | |
| index: | |
| if: github.repository == 'sourcegraph/scip' # Skip running on forks | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false # If a job fails allow others to continue | |
| matrix: | |
| target: | |
| - repository: kubernetes/kubernetes | |
| scip_binary: scip-go | |
| scip_args: "--verbose" | |
| - repository: google/guava | |
| scip_binary: scip-java | |
| scip_args: "index --verbose" | |
| # scip-java has problems with indexing Kotlin codebase | |
| # - repository: arrow-kt/arrow | |
| # scip_binary: scip-java | |
| # scip_args: "index --verbose" | |
| - repository: apache/pekko | |
| scip_binary: scip-java | |
| scip_args: "index --verbose" | |
| - repository: Textualize/rich | |
| scip_binary: scip-python | |
| scip_args: "index ." | |
| - repository: vuejs/core | |
| scip_binary: scip-typescript | |
| scip_args: "index" | |
| # scip-ruby does not have a Docker container image that we can use | |
| # out of the box. The existing one is for autoindexing purposes only. | |
| # - repository: Homebrew/brew | |
| # scip_binary: scip-ruby | |
| # scip_args: "" | |
| - repository: serde-rs/serde | |
| scip_binary: scip-rust | |
| scip_args: "" | |
| - repository: fmtlib/fmt | |
| scip_binary: scip-clang | |
| scip_args: "" | |
| container: sourcegraph/${{ matrix.target.scip_binary }}:latest | |
| concurrency: | |
| group: index-${{ matrix.target.repository }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout ${{ matrix.target.repository }} | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ matrix.target.repository }} | |
| fetch-depth: 1 | |
| - name: Generate compile_commands.json | |
| if: ${{ matrix.target.scip_binary == 'scip-clang' }} | |
| run: | | |
| apt-get update | |
| apt-get install -y bear cmake make g++ | |
| cmake -S . -B build | |
| bear -- make -C build | |
| - name: Install Go | |
| if: ${{ matrix.target.scip_binary == 'scip-go' }} | |
| uses: actions/setup-go@v5 | |
| with: { go-version-file: 'go.mod' } | |
| - name: Cache Maven dependencies | |
| if: ${{ matrix.target.scip_binary == 'scip-java' }} | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ matrix.target.repository }}-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven-${{ matrix.target.repository }}- | |
| ${{ runner.os }}-maven- | |
| - name: Setup Rust toolchain | |
| if: ${{ matrix.target.scip_binary == 'scip-rust' }} | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: rust-analyzer | |
| - name: Run SCIP | |
| run: | | |
| ${{ matrix.target.scip_binary }} --version | |
| ${{ matrix.target.scip_binary }} ${{ matrix.target.scip_args }} | |
| - name: Validate SCIP index size | |
| run: | | |
| size=$(stat -c%s index.scip) || { | |
| echo "ERROR: Failed to get SCIP index size" | |
| exit 1 | |
| } | |
| if [ "$size" -lt 1000000 ]; then | |
| echo "ERROR: SCIP dump suspiciously small (< 1MB)" | |
| exit 1 | |
| fi | |
| echo "SCIP dump size: $(du -h index.scip)" | |
| - name: Configure git safe.directory | |
| run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
| - name: Get src-cli | |
| run: | | |
| curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 \ | |
| -o /usr/local/bin/src | |
| chmod +x /usr/local/bin/src | |
| - name: Upload SCIP dump to Sourcegraph | |
| run: | | |
| src code-intel upload -no-progress \ | |
| -repo=github.com/${{ matrix.target.repository }} \ | |
| -file=index.scip | |
| env: | |
| SRC_ENDPOINT: https://sourcegraph.com/ | |
| # A repo-local secret with access token for a Service Account | |
| # that has a role allowing SCIP index upload. | |
| SRC_ACCESS_TOKEN: ${{ secrets.SRC_ACCESS_TOKEN_DOTCOM_SCIP_SA }} |