Skip to content

Add standardized Sourcegraph CI (build checks + code intel) #2

Add standardized Sourcegraph CI (build checks + code intel)

Add standardized Sourcegraph CI (build checks + code intel) #2

Workflow file for this run

name: SG CI - Node
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install deps
run: |
corepack enable || true
if [ -f yarn.lock ]; then yarn install --frozen-lockfile || yarn install || true;
elif [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile || pnpm install || true;
elif [ -f package-lock.json ]; then npm ci || npm install || true;
elif [ -f package.json ]; then npm install || true;
else echo "no manifest"; fi
- name: Typecheck
run: |
if [ -f tsconfig.json ]; then npx --yes -p typescript tsc -p tsconfig.json --noEmit;
else for f in $(git ls-files '*.js' '*.jsx' | head -n 300); do node --check "$f"; done; fi
code-intel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install scip-typescript and src-cli
run: |
npm install -g @sourcegraph/scip-typescript
curl -sfL https://demo.sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src
chmod +x /usr/local/bin/src
- name: Index and upload
env:
SRC_ENDPOINT: https://demo.sourcegraph.com
SRC_ACCESS_TOKEN: ${{secrets.SRC_ACCESS_TOKEN}}
run: |
npm install || true
scip-typescript index --infer-tsconfig --no-progress || scip-typescript index || true
if [ -f index.scip ]; then src code-intel upload -no-progress; else echo "no index produced"; fi