fix: make GitLab CI pipeline functional (#57) #139
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: master | |
| pull_request: | |
| branches: master | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: "**/go.sum" | |
| - name: Setup Swagger | |
| run: | | |
| go install github.com/swaggo/swag/cmd/swag@0b9e347c196710ea155a147782bf51707a600c2c # https://github.com/swaggo/swag/releases/tag/v1.16.4 | |
| swag init -g cmd/service/main.go | |
| - uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # https://github.com/golangci/golangci-lint-action/releases/tag/v6.5.0 | |
| with: | |
| install-mode: goinstall | |
| version: 0a603e49e5e9870f5f9f2035bcbe42cd9620a9d5 # https://github.com/golangci/golangci-lint/releases/tag/v1.64.5 | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: "**/go.sum" | |
| - name: Setup Swagger | |
| run: | | |
| go install github.com/swaggo/swag/cmd/swag@0b9e347c196710ea155a147782bf51707a600c2c # https://github.com/swaggo/swag/releases/tag/v1.16.4 | |
| swag init -g cmd/service/main.go | |
| - name: Run tests | |
| run: go test -race ./... | |
| detect-secrets: | |
| name: Detect Secrets | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: detect-secrets | |
| uses: reviewdog/action-detect-secrets@ec43c7e1b118c103185508d77db482c818baeec0 # https://github.com/reviewdog/action-detect-secrets/releases/tag/v0.27.1 | |
| with: | |
| reporter: github-pr-review | |
| detect_secrets_flags: --exclude-files '.*_test\.go$' | |
| govulncheck: | |
| name: Run govulncheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: "**/go.sum" | |
| - name: Setup Swagger | |
| run: | | |
| go install github.com/swaggo/swag/cmd/swag@0b9e347c196710ea155a147782bf51707a600c2c # https://github.com/swaggo/swag/releases/tag/v1.16.4 | |
| swag init -g cmd/service/main.go | |
| - name: Run govulncheck | |
| run: | | |
| go install golang.org/x/vuln/cmd/govulncheck@d1f380186385b4f64e00313f31743df8e4b89a77 # https://go.googlesource.com/vuln/+/refs/tags/v1.1.4 | |
| govulncheck -C . -format text ./... |