Skip to content
48 changes: 48 additions & 0 deletions .github/workflows/scip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Scip

on:
pull_request:
push:
branches:
- master

permissions:
contents: read
id-token: write


# TODO: replace this implementation with gha-dart once this:
# https://github.com/Workiva/gha-dart/pull/7 merges
jobs:
index:
runs-on: workiva-runner-dev
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: 2.18.7

- run: dart pub get

- run: dart pub global activate -spath .

- name: scip index
run: dart pub global run scip_dart ./

# provides SRC_ENDPOINT and SRC_ACCESS_TOKEN to the src installation step
- uses: Workiva/gha-setup-credentials@v1.0.0
with:
vault-url: https://vault-dev.workiva.org
vault-env: dev

# Install src cli
- name: Install Sourcegraph CLI
run: |
curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o _src-cli
chmod +x _src-cli
./_src-cli login
echo ./_src-cli endpoint $SRC_ENDPOINT
echo ./_src-cli access token $SRC_ACCESS_TOKEN

- name: Upload scip to sourcegraph
run: ./_src-cli code-intel upload -file=index.scip -github-token="${{ env.FEF_GH_TOKEN }}"
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Snapshots Diff Check
run: |
dart ./bin/main.dart ./snapshots/input/basic-project
dart run scip_dart ./snapshots/input/basic-project
./scip snapshot --to ./snapshots/output/basic-project

if [[ -z "$(git status --porcelain ./snapshots/output)" ]];
Expand Down Expand Up @@ -75,4 +75,4 @@ jobs:
package-path: ${{ matrix.repo }}

- run: |
dart ./bin/main.dart ./${{ matrix.repo }} || exit 1
dart run scip_dart ./${{ matrix.repo }} || exit 1
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ Experimental spike on a [scip](https://github.com/sourcegraph/scip) indexer for

Designed to be a replacement for [lsif_indexer](https://github.com/Workiva/lsif_indexer), with better coverage and reliability

## Installation

```sh
dart pub global activate --hosted-url https://pub.workiva.org scip_dart
```

## Usage

The following command will output a `index.scip` file
```sh
dart scip-dart/bin/main.dart ./path/to/project/root
dart pub global run scip_dart ./path/to/project/root
```

This file can be analyzed / displayed using the [scip cli](https://github.com/sourcegraph/scip)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ environment:
sdk: ">=2.18.0 <3.0.0"

executables:
scip-dart: main.dart
scip_dart:

dependencies:
analyzer: ^5.4.0
Expand Down