-
-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make DeepSource action work for all PRs
Use a workflow_run action so that it can access the secret required to upload to Deep Source.
- Loading branch information
Showing
5 changed files
with
51 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: build | ||
on: [push, pull_request] | ||
jobs: | ||
ci: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
go: ['1.20', '1.21'] | ||
os: ['ubuntu-latest', 'windows-latest'] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Set up Go ${{ matrix.go }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
id: go | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: make ci | ||
- name: Upload test coverage for deep source | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage | ||
path: cover.out | ||
|
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: deepsource | ||
on: | ||
workflow_run: | ||
workflows: [build] | ||
types: [completed] | ||
|
||
jobs: | ||
on-success: | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion == 'success' | ||
steps: | ||
- name: Download test coverage | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: coverage | ||
path: cover.out | ||
- name: Report analysis to DeepSource | ||
run: | | ||
curl https://deepsource.io/cli | sh | ||
./bin/deepsource report --analyzer test-coverage --key go --value-file ./cover.out | ||
env: | ||
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} |
This file contains 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