-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Allan Sifuna <[email protected]>
- Loading branch information
1 parent
3a9307a
commit de9ec0b
Showing
31 changed files
with
3,715 additions
and
3,481 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ env: | |
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }} | ||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | ||
FIREBASE_WEB_API_KEY: ${{ secrets.FIREBASE_WEB_API_KEY }} | ||
ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | ||
ROOT_COLLECTION_SUFFIX: ${{ secrets.ROOT_COLLECTION_SUFFIX }} | ||
|
@@ -28,53 +29,38 @@ jobs: | |
lint_and_test: | ||
strategy: | ||
matrix: | ||
go-version: [1.17.x] | ||
go-version: [1.21.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 80 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: google-github-actions/setup-gcloud@main | ||
with: | ||
project_id: ${{ secrets.GOOGLE_CLOUD_PROJECT }} | ||
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | ||
export_default_credentials: true | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
args: --timeout=10m | ||
|
||
- name: Install Go dependencies | ||
run: | | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.37.1 | ||
go get -d github.com/kisielk/errcheck | ||
go get -d golang.org/x/lint/golint | ||
go install honnef.co/go/tools/cmd/staticcheck@latest | ||
go get -d github.com/axw/gocov/gocov | ||
go get -d github.com/securego/gosec/cmd/gosec | ||
go get -d github.com/ory/go-acc | ||
go get -d github.com/client9/misspell/cmd/misspell | ||
go get -d github.com/gordonklaus/ineffassign | ||
go get github.com/fzipp/gocyclo | ||
go get github.com/stretchr/testify/[email protected] | ||
go get github.com/ory/go-acc | ||
go get golang.org/x/oauth2/internal | ||
go install github.com/savannahghi/bewellcli@$CLI_VERSION | ||
go install github.com/axw/gocov/gocov@latest | ||
go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
go install github.com/ory/go-acc@latest | ||
go get go.opentelemetry.io/otel/metric/[email protected] | ||
- uses: 'google-github-actions/auth@v1' | ||
with: | ||
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" | ||
project_id: ${{ secrets.GOOGLE_CLOUD_PROJECT }} | ||
|
||
- name: Run lint and test | ||
run: | | ||
staticcheck ./... | ||
bewellcli service validate-schema --name onboarding --version $GITHUB_SHA --url ${{ secrets.SERVICE_GRAPHQL_URL }} | ||
go fmt $(go list ./... | grep -v /vendor/) | ||
go vet $(go list ./... | grep -v /vendor/) | ||
golint -set_exit_status $(go list ./... | grep -v /vendor/) | ||
errcheck -ignore 'os:.*,' $(go list ./... | grep -v /vendor/) | ||
misspell -error . | ||
gosec -exclude=G304,G101 ./... | ||
go-acc -o coverage.txt --ignore generated,cmd ./... -- -timeout 60m | ||
grep -v "generated.go" coverage.txt | grep -v "_gen.go" | grep -v "mocks.go" | grep -v "*resolver*go" | grep -v "server.go" > coverage.out | ||
go-acc -o coverage.txt --ignore generated,cmd,graph,tests, engagement ./... -- -timeout 60m | ||
grep -v "generated.go" coverage.txt | grep -v "_gen.go" | grep -v "mocks.go" | grep -v "*mocks.go" | grep -v "mock.go" | grep -v "*mock.go" | grep -v "*resolvers*go" | grep -v "*.resolvers.go" | grep -v "server.go" > coverage.out | ||
go tool cover -html=coverage.out -o coverage.html | ||
gocov convert coverage.out > coverage.json | ||
gocov report coverage.json > coverage_report.txt | ||
|
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
Oops, something went wrong.