浏览代码

chore: generate SCIP instead of LSIF (#7445)

Joe Chen 1 年之前
父节点
当前提交
167cdb09e3
共有 2 个文件被更改,包括 38 次插入33 次删除
  1. 0 33
      .github/workflows/lsif.yml
  2. 38 0
      .github/workflows/scip.yml

+ 0 - 33
.github/workflows/lsif.yml

@@ -1,33 +0,0 @@
-name: LSIF
-on:
-  push:
-    paths:
-      - '**.go'
-      - 'go.mod'
-      - '.github/workflows/lsif.yml'
-env:
-  GOPROXY: "https://proxy.golang.org"
-
-jobs:
-  lsif-go:
-    if: github.repository == 'gogs/gogs'
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-      - name: Generate LSIF data
-        uses: sourcegraph/lsif-go-action@master
-      - name: Upload LSIF data to sourcegraph.com
-        continue-on-error: true
-        uses: docker://sourcegraph/src-cli:latest
-        with:
-          args: lsif upload -github-token=${{ secrets.GITHUB_TOKEN }}
-      - name: Upload LSIF data to S2
-        continue-on-error: true
-        uses: docker://sourcegraph/src-cli:latest
-        with:
-          args: -endpoint=https://sourcegraph.sourcegraph.com lsif upload -github-token=${{ secrets.GITHUB_TOKEN }}
-      - name: Upload LSIF data to cs.unknwon.dev
-        continue-on-error: true
-        uses: docker://sourcegraph/src-cli:latest
-        with:
-          args: -endpoint=https://cs.unknwon.dev lsif upload -github-token=${{ secrets.GITHUB_TOKEN }}

+ 38 - 0
.github/workflows/scip.yml

@@ -0,0 +1,38 @@
+name: SCIP
+on:
+  push:
+    paths:
+      - '**.go'
+      - 'go.mod'
+      - '.github/workflows/scip.yml'
+env:
+  GOPROXY: "https://proxy.golang.org"
+
+jobs:
+  scip-go:
+    if: github.repository == 'gogs/gogs'
+    runs-on: ubuntu-latest
+    container: sourcegraph/scip-go
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+      - name: Set directory to safe for git
+        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: Generate SCIP data
+        run: scip-go --no-animation
+      - name: Upload SCIP data to sourcegraph.com
+        run: src code-intel upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress -repo=github.com/gogs/gogs
+        env:
+          SRC_ENDPOINT: https://sourcegraph.com/
+      - name: Upload SCIP data to S2
+        run: src code-intel upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress -repo=github.com/gogs/gogs
+        env:
+          SRC_ENDPOINT: https://sourcegraph.sourcegraph.com/
+      - name: Upload SCIP data to cs.unknwon.dev
+        run: src code-intel upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress -repo=github.com/gogs/gogs
+        env:
+          SRC_ENDPOINT: https://cs.unknwon.dev/