|
| 1 | +name: SCIP index uploading |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 0 * * *' # Run every day at midnight UTC |
| 6 | + workflow_dispatch: # Allow manual triggering |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +jobs: |
| 12 | + index-k8s: |
| 13 | + if: github.repository == 'sourcegraph/scip' # Skip running on forks |
| 14 | + runs-on: ubuntu-latest |
| 15 | + timeout-minutes: 30 |
| 16 | + concurrency: |
| 17 | + group: index-k8s |
| 18 | + cancel-in-progress: true |
| 19 | + container: sourcegraph/scip-go:latest |
| 20 | + steps: |
| 21 | + - name: Checkout kubernetes/kubernetes |
| 22 | + uses: actions/checkout@v5 |
| 23 | + with: |
| 24 | + repository: kubernetes/kubernetes |
| 25 | + ref: master |
| 26 | + fetch-depth: 1 |
| 27 | + |
| 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 |
| 36 | +
|
| 37 | + - name: Install Go |
| 38 | + uses: actions/setup-go@v5 |
| 39 | + with: { go-version-file: 'go.mod' } |
| 40 | + |
| 41 | + - name: Run scip-go |
| 42 | + run: | |
| 43 | + scip-go --version |
| 44 | + scip-go --verbose |
| 45 | +
|
| 46 | + - name: Validate SCIP index size |
| 47 | + run: | |
| 48 | + if [ $(stat -c%s index.scip) -lt 10000000 ]; then |
| 49 | + echo "ERROR: SCIP dump suspiciously small (< 10MB)" |
| 50 | + exit 1 |
| 51 | + fi |
| 52 | + echo "SCIP dump size: $(du -h index.scip)" |
| 53 | +
|
| 54 | + - name: Upload SCIP dump to Sourcegraph |
| 55 | + run: | |
| 56 | + src code-intel upload -no-progress \ |
| 57 | + -repo=github.com/kubernetes/kubernetes \ |
| 58 | + -file=index.scip |
| 59 | + env: |
| 60 | + SRC_ENDPOINT: https://sourcegraph.com/ |
| 61 | + # A repo-local secret with access token for a Service Account |
| 62 | + # that has a role allowing SCIP index upload. |
| 63 | + SRC_ACCESS_TOKEN: ${{ secrets.SRC_ACCESS_TOKEN_DOTCOM_SCIP_SA }} |
0 commit comments