Skip to content

fix: authenticate with X-Bearer header #70

fix: authenticate with X-Bearer header

fix: authenticate with X-Bearer header #70

Workflow file for this run

name: Test
on: [push]
env:
SIL_COMMS_BASE_URL: ${{ secrets.SIL_COMMS_BASE_URL }}
SIL_COMMS_EMAIL: ${{ secrets.SIL_COMMS_EMAIL }}
SIL_COMMS_PASSWORD: ${{ secrets.SIL_COMMS_PASSWORD }}
SIL_COMMS_SENDER_ID: ${{ secrets.SIL_COMMS_SENDER_ID }}
jobs:
lint_and_test:
strategy:
fail-fast: true
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4.1.7
- name: Install Go
uses: actions/setup-go@v5.0.1
with:
go-version: ${{ matrix.go-version }}
- name: Run lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
- name: Install Go dependencies
run: |
go mod download
go get github.com/axw/gocov/gocov@latest
go get github.com/ory/go-acc@latest
go install github.com/ory/go-acc@latest
go install github.com/axw/gocov/gocov@latest
- name: Run test
run: |
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
- name: Quality Gate - Test coverage shall be above threshold
env:
TESTCOVERAGE_THRESHOLD: 80.0
run: |
bash scripts/coverage.sh