Skip to content

Commit a9cb36b

Browse files
authored
Deepsource (#63)
* chore: trying out deepsource * ci: added deepsource coverage report * renamed workflow
1 parent 1ac5942 commit a9cb36b

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed

.deepsource.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,26 @@ exclude_patterns = ["**/*.pb.go"]
99

1010
[[analyzers]]
1111
name = "test-coverage"
12+
enabled = true
1213

1314
[[analyzers]]
1415
name = "shell"
16+
enabled = true
1517

1618
[[analyzers]]
1719
name = "secrets"
20+
enabled = true
1821

1922
[[analyzers]]
2023
name = "docker"
24+
enabled = true
2125

2226
[analyzers.meta]
2327
dockerfile_paths = ["Dockerfile"]
2428

2529
[[analyzers]]
2630
name = "go"
31+
enabled = true
2732

2833
[analyzers.meta]
2934
import_root = "github.com/MadsRC/sophrosyne"
30-
31-
[[transformers]]
32-
name = "gofmt"

.github/workflows/deepsource.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
concurrency:
2+
group: ${{ github.workflow }}-${{ github.ref }}
3+
cancel-in-progress: true
4+
5+
on:
6+
# Trigger analysis when pushing in master or pull requests, and when creating
7+
# a pull request.
8+
push:
9+
branches:
10+
- main
11+
pull_request:
12+
types: [opened, synchronize, reopened]
13+
name: DeepSource analysis
14+
jobs:
15+
sonarcloud:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
19+
with:
20+
# Disabling shallow clone is recommended for improving relevancy of reporting
21+
fetch-depth: 0
22+
# See https://docs.deepsource.com/docs/analyzers-test-coverage#with-github-actions
23+
ref: ${{ github.event.pull_request.head.sha }}
24+
- uses: jdx/mise-action@0c39a522dfbced3ed83924152c45804a71ce216f # v2.0.4
25+
with:
26+
experimental: true
27+
- run: mise run dev:lint --no-fail
28+
- run: mise run test:unit
29+
- name: Report results to DeepSource
30+
run: |
31+
# Tests have finished and a test coverage report is available
32+
33+
# Install deepsource CLI
34+
curl https://deepsource.io/cli | sh
35+
36+
# From the root directory, run the report coverage command
37+
./bin/deepsource report --analyzer test-coverage --key go --value-file build/unit_coverage.out
38+
39+
env:
40+
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}

0 commit comments

Comments
 (0)