Skip to content

Merge pull request #19 from wednesday-solutions/alenbaby13-patch-1 #67

Merge pull request #19 from wednesday-solutions/alenbaby13-patch-1

Merge pull request #19 from wednesday-solutions/alenbaby13-patch-1 #67

name: Go-Template CI Master - Test
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
lint-test-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- 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
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
with:
args: >
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# testing image url
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: golangci/golangci-lint-action@v3.2.0