build(deps): bump actions/checkout from 3.5.3 to 4.1.1 (#104) #153
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
version: | |
name: Generate version | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }} | |
PreReleaseTag: ${{ steps.gitversion.outputs.PreReleaseTag }} | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: "5.x" | |
- name: Use GitVersion | |
id: gitversion # step id used as reference for output values | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Create annotation for build error | |
run: | | |
echo "::notice::FullSemVer ${{ steps.gitversion.outputs.FullSemVer }}" | |
echo "::notice::PreReleaseTag ${{ steps.gitversion.outputs.PreReleaseTag }}" | |
test: | |
name: Build and test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: ["1.x"] | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Build | |
run: go build -race -v ./... | |
- name: Test | |
run: go test -race -v ./... | |
golangci: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ^1.20 | |
- name: golangci-lint | |
uses: golangci/[email protected] | |
with: | |
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | |
version: latest | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
needs: [version] | |
steps: | |
- uses: actions/[email protected] | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
with: | |
args: > | |
-Dsonar.projectVersion=${{ needs.version.outputs.FullSemVer }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |