This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
Merge branch 'master' into develop #128
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: Go | |
on: | |
push: | |
branches: [ develop ] | |
pull_request: | |
branches: [ develop ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
env: | |
GO111MODULE: on | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ^1.21 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
# Get Project dependencies | |
- name: Get dependencies | |
run: | | |
if [ -f go.mod ]; then | |
go mod tidy | |
go mod verify | |
go get github.com/ory/go-acc | |
go get github.com/mattn/goveralls | |
fi | |
# Get Project dependencies | |
- name: Create Coverage report | |
run: | | |
go install github.com/ory/go-acc@latest | |
go-acc -o coverage.out ./... -- -timeout 30m | |
# Sonar cloud scan for TDBackend project | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.SQGH_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Install goveralls | |
run: go install github.com/mattn/goveralls@latest | |
- name: Code coverage | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: goveralls -coverprofile=coverage.out -service=github | |
# GoSec security scanner | |
- name: Run Gosec Security Scanner | |
run: | | |
go install github.com/securego/gosec/v2/cmd/gosec@latest | |
gosec ./... | |
- name: Build | |
run: go build -v . | |
- name: Test | |
run: go test -v . |