Skip to content

Merge pull request #13 from oleksandrkhmil/feature/update-ci #16

Merge pull request #13 from oleksandrkhmil/feature/update-ci

Merge pull request #13 from oleksandrkhmil/feature/update-ci #16

Workflow file for this run

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/main.go
- uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # https://github.com/golangci/golangci-lint-action/releases/tag/v6.1.1
with:
version: v1.61
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/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/main.go
- name: Run govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@4ea4418106cea3bb2c9aa098527c924e9e1fbbb4 # https://go.googlesource.com/vuln/+/refs/tags/v1.1.3
govulncheck -C . -format text ./...