Skip to content

feat: add pagination validation #85

feat: add pagination validation

feat: add pagination validation #85

Workflow file for this run

name: Test
on: [push]
env:
DOCKER_BUILDKIT: 1 # Enable Buildkit and let compose use it to speed up image building
COMPOSE_DOCKER_CLI_BUILD: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
PORT: ${{ secrets.PORT }}
DEBUG: ${{ secrets.DEBUG }}
IS_RUNNING_TESTS: ${{ secrets.IS_RUNNING_TESTS }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
FIREBASE_WEB_API_KEY: ${{ secrets.FIREBASE_WEB_API_KEY }}
FIREBASE_DYNAMIC_LINKS_DOMAIN: ${{ secrets.FIREBASE_DYNAMIC_LINKS_DOMAIN }}
CLOUDSDK_CORE_DISABLE_PROMPTS: ${{ secrets.CLOUDSDK_CORE_DISABLE_PROMPTS }}
GOOGLE_PROJECT_NUMBER: ${{ secrets.GOOGLE_PROJECT_NUMBER }}
ROOT_COLLECTION_SUFFIX: ${{ secrets.ROOT_COLLECTION_SUFFIX }}
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
jobs:
lint_and_test:
strategy:
matrix:
go-version: [1.18.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 80
steps:
- uses: actions/[email protected]
- uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}'
project_id: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
- name: Install Go
uses: actions/[email protected]
with:
go-version: ${{ matrix.go-version }}
- 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
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.13.1
go install honnef.co/go/tools/cmd/[email protected]
go install github.com/ory/go-acc@latest
go install github.com/axw/gocov/gocov@latest
go install github.com/kisielk/errcheck@latest
- name: Run lint and test
run: |
staticcheck ./...
go fmt $(go list ./... | grep -v /vendor/)
go vet $(go list ./... | grep -v /vendor/)
errcheck -ignore 'os:.*,' $(go list ./... | grep -v /vendor/)
gosec -exclude=G304,G101 ./...
go-acc -o coverage.txt --ignore generated,cmd ./... -- -timeout 60m
grep -v "generated.go" coverage.txt > coverage.out
go tool cover -html=coverage.out -o coverage.html
gocov convert coverage.out > coverage.json
gocov report coverage.json > coverage_report.txt
tail coverage_report.txt
- name: Install goveralls
env:
GO111MODULE: off
run: go get github.com/mattn/goveralls
# - name: Send coverage
# env:
# COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: goveralls -coverprofile=coverage.out -service=github