diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d5963a7..ffad17c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "Go", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/go:1-1.21-bookworm", + "image": "mcr.microsoft.com/devcontainers/go:1-1.22-bookworm", // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 477e6c9..f5f7448 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.21' + go-version: '1.22' - name: Build run: go build -v ./cmd/flash/ diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 3407dfd..5d80ab0 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21' + go-version: '1.22' cache: false - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index afa94fc..13fb926 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -30,7 +30,6 @@ on: push: branches: [ "main" ] pull_request: - branches: [ "main" ] workflow_dispatch: permissions: @@ -41,6 +40,17 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22' + + - name: Run tests and generate coverage profile + run: go test ./... -coverprofile=coverage.prof + - name: Analyze with SonarQube # You can pin the exact commit or the version. @@ -57,7 +67,7 @@ jobs: # mandatory -Dsonar.projectKey=flash # Comma-separated paths to directories containing main source files. - #-Dsonar.sources= # optional, default is project base directory + #-Dsonar.sources=. # When you need the analysis to take place in a directory other than the one from which it was launched #-Dsonar.projectBaseDir= # optional, default is . # Comma-separated paths to directories containing test source files. diff --git a/go.mod b/go.mod index e20e821..e1eafeb 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ardevd/flash -go 1.21.1 +go 1.22 require ( github.com/btcsuite/btcd/btcutil v1.1.5 diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..237fce1 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectVersion=v0.0.1 +sonar.sources=. +sonar.sourceEncoding=UTF-8 +sonar.language=go + +sonar.exclusions=**/*_test.go,*.py +sonar.go.coverage.reportPaths=./coverage.prof