-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (29 loc) · 871 Bytes
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Build & Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.4"
- name: Build
run: go build -v ./...
- name: Test & Generate Coverfile
run: go test -coverprofile=cover.out -v ./...
- name: Report test coverage results to DeepSource
run: |
# Install deepsource CLI
curl https://deepsource.io/cli | sh
# From the root directory, run the report coverage command
./bin/deepsource report --analyzer test-coverage --key go --value-file ./cover.out
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}