Skip to content
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 .github/workflows/pull-request-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3
with:
go-version: '1.24'
go-version: '1.25.4'

- name: Download dependencies
run: go get -d -t ./...
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Multiapps CLI Plugin Sonar Scan

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read
pull-requests: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Full history so SonarCloud can compute new-code and blame data.
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3
with:
go-version: '1.25.4'

- name: Build and Test with Coverage
run: |
go build -v ./...
go test -coverprofile=coverage.out ./...

- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
args: --output.json.path=golangci-report.json
continue-on-error: true

- name: Sonar Scan
uses: SonarSource/sonarqube-scan-action@aa494459d7c39c106cc77b166de8b4250a32bb97 # v5.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
16 changes: 16 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# golangci-lint configuration for multiapps-cli-plugin
# Runs a standard set of Go linters; JSON output is uploaded to SonarCloud.
run:
timeout: 5m

issues:
exclude-dirs:
- test_resources

linters:
enable:
- govet
- staticcheck
- errcheck
- ineffassign
- unused
14 changes: 14 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sonar.projectKey=cloudfoundry_multiapps-cli-plugin
sonar.organization=cloudfoundry
sonar.projectName="MultiApps CLI Plugin"

# Source and test layout
sonar.sources=.
sonar.tests=.
sonar.test.inclusions=**/*_test.go
sonar.exclusions=\
**/test_resources/**

# Go analysis inputs
sonar.go.coverage.reportPaths=coverage.out
sonar.go.golangci-lint.reportPaths=golangci-report.json
Loading