Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DeepSource action work for all PRs #3368

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ enabled = true
name = "go"

[analyzers.meta]
import_root = "github.com/goadesign/goa"
import_root = "goa.design/goa/v3"
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: build
on: [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

35 changes: 0 additions & 35 deletions .github/workflows/ci.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/deep-source.yml
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 }}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ test:
go test ./... --coverprofile=cover.out

release: release-goa release-examples release-plugins
@echo "Release v$(MAJOR).$(MINOR).$(BUILD) complete"

release-goa:
# First make sure all is clean
Expand All @@ -85,7 +86,7 @@ release-goa:
git checkout v$(MAJOR) && \
git pull origin v$(MAJOR) && \
git diff-index --quiet HEAD
go mod tidy -compat=1.17
go mod tidy
# Bump version number, commit and push
sed 's/Major = .*/Major = $(MAJOR)/' pkg/version.go > _tmp && mv _tmp pkg/version.go
sed 's/Minor = .*/Minor = $(MINOR)/' pkg/version.go > _tmp && mv _tmp pkg/version.go
Expand Down Expand Up @@ -118,5 +119,4 @@ release-plugins:
git tag v$(MAJOR).$(MINOR).$(BUILD) && \
git push origin v$(MAJOR) && \
git push origin v$(MAJOR).$(MINOR).$(BUILD)
echo DONE RELEASING v$(MAJOR).$(MINOR).$(BUILD)!