Skip to content

Merge pull request #74 from panapol-p/dependabot/go_modules/github.co… #121

Merge pull request #74 from panapol-p/dependabot/go_modules/github.co…

Merge pull request #74 from panapol-p/dependabot/go_modules/github.co… #121

Workflow file for this run

name: tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Compile and Test
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- run: mkdir bin
- run: go test -json ./... -covermode=atomic -coverprofile=bin/coverage.out -json > bin/report.json
## disable lint (gosimple,staticcheck,unused,staticcheck is disabled because of go1.18)
#- name: lint
# if: github.event_name == 'pull_request'
# uses: golangci/golangci-lint-action@v4
# with:
# version: latest
# skip-build-cache: true
# skip-pkg-cache: true
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: bin
sonarCloudTrigger:
needs: build
name: SonarCloud Trigger
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Download code coverage results
uses: actions/download-artifact@v4
with:
name: code-coverage-report
path: bin
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}