Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Update go.yml

Update go.yml #119

Workflow file for this run

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@v2
with:
go-version: ^1.20
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
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: Code coverage
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ github.workspace }}/coverage.out
# 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 .