feat: add new sil comms auth (#82) #485
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 }} | |
PORT: ${{ secrets.PORT }} | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }} | |
FIREBASE_WEB_API_KEY: ${{ secrets.FIREBASE_WEB_API_KEY }} | |
ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | |
ROOT_COLLECTION_SUFFIX: ${{ secrets.ROOT_COLLECTION_SUFFIX }} | |
JWT_KEY: ${{ secrets.JWT_KEY }} | |
GHOST_CMS_API_ENDPOINT: ${{ secrets.GHOST_CMS_API_ENDPOINT }} | |
GHOST_CMS_API_KEY: ${{ secrets.GHOST_CMS_API_KEY }} | |
GOOGLE_PROJECT_NUMBER: ${{ secrets.GOOGLE_PROJECT_NUMBER }} | |
SERVICE_HOST: ${{ secrets.SERVICE_HOST }} | |
MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} | |
MAILGUN_DOMAIN: ${{ secrets.MAILGUN_DOMAIN }} | |
MAILGUN_FROM: ${{ secrets.MAILGUN_FROM }} | |
SEND_IN_BLUE_API_KEY: ${{ secrets.SEND_IN_BLUE_API_KEY }} | |
SEND_IN_BLUE_ENABLED: ${{ secrets.SEND_IN_BLUE_ENABLED }} | |
TWILIO_VIDEO_SID: ${{ secrets.TWILIO_VIDEO_SID }} | |
TWILIO_VIDEO_SECRET: ${{ secrets.TWILIO_VIDEO_SECRET }} | |
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} | |
TWILIO_ACCOUNT_AUTH_TOKEN: ${{ secrets.TWILIO_ACCOUNT_AUTH_TOKEN }} | |
TWILIO_SMS_NUMBER: ${{ secrets.TWILIO_SMS_NUMBER }} | |
SERVER_PUBLIC_DOMAIN: ${{ secrets.SERVER_PUBLIC_DOMAIN }} | |
AIT_API_KEY: ${{ secrets.AIT_API_KEY }} | |
AIT_USERNAME: ${{ secrets.AIT_USERNAME }} | |
AIT_SENDER_ID: ${{ secrets.AIT_SENDER_ID }} | |
AIT_ENVIRONMENT: ${{ secrets.AIT_ENVIRONMENT }} | |
TWILIO_WHATSAPP_SID: ${{ secrets.TWILIO_WHATSAPP_SID }} | |
TWILIO_WHATSAPP_AUTH_TOKEN: ${{ secrets.TWILIO_WHATSAPP_AUTH_TOKEN }} | |
TWILIO_WHATSAPP_SENDER: ${{ secrets.TWILIO_WHATSAPP_SENDER }} | |
TWILIO_REGION: ${{ secrets.TWILIO_REGION }} | |
TWILIO_VIDEO_API_URL: ${{ secrets.TWILIO_VIDEO_API_URL }} | |
AIT_BEWELL_API_KEY: ${{ secrets.AIT_BEWELL_API_KEY }} | |
AIT_BEWELL_USERNAME: ${{ secrets.AIT_BEWELL_USERNAME }} | |
AIT_BEWELL_SENDER_ID: ${{ secrets.AIT_BEWELL_SENDER_ID }} | |
TESTING_TWILIO_ACCOUNT_AUTH_TOKEN: ${{ secrets.TESTING_TWILIO_ACCOUNT_AUTH_TOKEN }} | |
TESTING_TWILIO_ACCOUNT_SID: ${{ secrets.TESTING_TWILIO_ACCOUNT_SID }} | |
TEST_TWILIO_SMS_NUMBER: ${{ secrets.TEST_TWILIO_SMS_NUMBER }} | |
SCHEMA_HOST: ${{ secrets.SCHEMA_HOST }} | |
JAEGER_URL: ${{ secrets.JAEGER_URL }} | |
# Schema Registry CLI command version | |
CLI_VERSION: v0.0.1 | |
# Schema Registry URL | |
REGISTRY_URL: ${{ secrets.TEST_SCHEMA_REGISTRY_URL }} | |
concurrency: | |
group: lint-and-test | |
jobs: | |
lint_and_test: | |
strategy: | |
matrix: | |
go-version: [1.17.x] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 80 | |
steps: | |
- uses: actions/checkout@v2 | |
- 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@v3 | |
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 | |
go get -u github.com/kisielk/errcheck | |
go get -u golang.org/x/lint/golint | |
go get -u honnef.co/go/tools/cmd/staticcheck | |
go get -u github.com/axw/gocov/gocov | |
go get -u github.com/securego/gosec/cmd/gosec | |
go get -u github.com/ory/go-acc | |
go get -u github.com/client9/misspell/cmd/misspell | |
go get -u 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 install github.com/savannahghi/bewellcli@$CLI_VERSION | |
go get golang.org/x/oauth2/internal | |
- name: Run lint | |
run: | | |
staticcheck ./... | |
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 ./... | |
# TODO: Restore tests | |
# - name: Run test | |
# 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 "*mocks.go" | grep -v "mock.go" | grep -v "*mock.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: 43.7 | |
# run: | | |
# bash scripts/coverage.sh |