Skip to content

Fix/setup

Fix/setup #613

name: Go-Template CI Master - Test
on:
pull_request:
branches:
- master
jobs:
lint-test-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v3
- name: SetupGoV5
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Get branch name
id: vars
run: echo ::set-output name=branch::${{ github.event.pull_request.head.ref }}
- name: Install pre-commit dependencies
run: |
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/go-critic/go-critic/cmd/gocritic@latest
go install golang.org/x/lint/golint@latest
go install github.com/BurntSushi/toml/cmd/tomlv@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- uses: pre-commit/action@v3.0.0
- name: Build
run: go build ./...
- name: Test
run: ./scripts/test.sh
# - uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: true
# files: ./coverage.out
# verbose: true
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- uses: golangci/golangci-lint-action@v3