feat: patch patient viral load observation #1507
Workflow file for this run
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: 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 }} | |
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }} | |
ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | |
SERVICE_HOST: ${{ secrets.SERVICE_HOST }} | |
GOOGLE_PROJECT_NUMBER: ${{ secrets.GOOGLE_PROJECT_NUMBER }} | |
CLOUD_HEALTH_PUBSUB_TOPIC: ${{ secrets.CLOUD_HEALTH_PUBSUB_TOPIC }} | |
CLOUD_HEALTH_DATASET_ID: ${{ secrets.CLOUD_HEALTH_DATASET_ID }} | |
OPENCONCEPTLAB_TOKEN: ${{ secrets.OPENCONCEPTLAB_TOKEN }} | |
OPENCONCEPTLAB_API_URL: ${{ secrets.OPENCONCEPTLAB_API_URL }} | |
CLOUD_HEALTH_FHIRSTORE_ID: ${{ secrets.CLOUD_HEALTH_FHIRSTORE_ID }} | |
CLOUD_HEALTH_DATASET_LOCATION: ${{ secrets.CLOUD_HEALTH_DATASET_LOCATION }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
JWT_KEY: ${{ secrets.JWT_KEY }} | |
SAVANNAH_ADMIN_EMAIL: ${{ secrets.SAVANNAH_ADMIN_EMAIL }} | |
AUTHSERVER_ENDPOINT: ${{ secrets.AUTHSERVER_ENDPOINT }} | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
AUTH_USERNAME: ${{ secrets.AUTH_USERNAME }} | |
AUTH_PASSWORD: ${{ secrets.AUTH_PASSWORD }} | |
GRANT_TYPE: ${{ secrets.GRANT_TYPE }} | |
MYCAREHUB_CLIENT_ID: ${{ secrets.MYCAREHUB_CLIENT_ID }} | |
MYCAREHUB_CLIENT_SECRET: ${{ secrets.MYCAREHUB_CLIENT_SECRET }} | |
MYCAREHUB_INTROSPECT_URL: ${{ secrets.MYCAREHUB_INTROSPECT_URL }} | |
CLINICAL_BUCKET_NAME: ${{ secrets.CLINICAL_BUCKET_NAME }} | |
SENTRY_TRACE_SAMPLE_RATE: ${{ secrets.SENTRY_TRACE_SAMPLE_RATE }} | |
jobs: | |
golangci: | |
strategy: | |
matrix: | |
go-version: [1.19.x] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- 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 | |
lint_and_test: | |
needs: [golangci] | |
strategy: | |
matrix: | |
go-version: [1.19.x] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 80 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: google-github-actions/setup-gcloud@v0 | |
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@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install Go dependencies | |
run: | | |
go mod download | |
go get github.com/axw/gocov/gocov | |
go get github.com/ory/go-acc | |
go install github.com/ory/go-acc | |
go install github.com/axw/gocov/gocov | |
go get github.com/savannahghi/serverutils@v0.0.7 | |
- name: Run tests | |
run: | | |
go-acc -o coverage.txt --ignore generated,cmd,graph ./... -- -timeout 60m | |
grep -v "generated.go" coverage.txt | grep -v "_gen.go" | grep -v "_mock.go" | grep -v "*mock.go" | grep -v "mocks.go" | grep -v "*resolver*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 | |
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 | |
- name: Quality Gate - Test coverage shall be above threshold | |
env: | |
TESTCOVERAGE_THRESHOLD: 80.0 | |
run: | | |
bash scripts/coverage.sh |