Keploy Integration in CI #567
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-Template CI Master - Test | |
on: | |
pull_request_target: | |
branches: | |
- master | |
push: | |
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/[email protected] | |
- name: Build | |
run: go build ./... | |
- name: Test | |
run: ./scripts/test.sh | |
- name: Keploy test | |
run: chmod +x ./scripts/keploy_ci.sh && ./scripts/keploy_ci.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 | |
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@v5 | |
with: | |
go-version: '1.22' | |
- uses: golangci/golangci-lint-action@v3 |