Build #150
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: Build | |
on: | |
schedule: | |
- cron: "0 6 * * WED" | |
push: | |
tags-ignore: | |
- "**" | |
branches: | |
- master | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
call-ghlint: | |
name: Call Lint Github workflows | |
uses: azazeal/workflows/.github/workflows/ghlint.yml@master | |
permissions: | |
pull-requests: write | |
call-golint: | |
name: Call Lint Go package | |
uses: azazeal/workflows/.github/workflows/golint.yml@master | |
permissions: | |
pull-requests: write | |
test: | |
needs: call-golint | |
name: Run test suite | |
runs-on: ubuntu-latest | |
services: | |
secure: | |
image: azazeal/vasctest:f6fa22e | |
ports: | |
- 10000 | |
options: >- | |
--health-cmd "nc -z localhost 10000" | |
--health-interval 1s | |
--health-timeout 1s | |
--health-retries 10 | |
--health-start-period 5s | |
insecure: | |
image: azazeal/vasctest:f6fa22e | |
env: | |
INSECURE: true | |
ports: | |
- 10000 | |
options: >- | |
--health-cmd "nc -z localhost 10000" | |
--health-interval 1s | |
--health-timeout 1s | |
--health-retries 10 | |
--health-start-period 5s | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
- name: Setup Go | |
id: setup-go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
- name: Install gotestsum | |
run: | | |
go install gotest.tools/gotestsum@v1 | |
- name: Run test suite | |
run: | | |
gotestsum -- -race -coverpkg=./... -coverprofile=coverprofile -covermode=atomic ./... | |
env: | |
GOTESTSUM_JSONFILE: gotestsum.json | |
SECURE_HOST: localhost:${{ job.services.secure.ports['10000'] }} | |
SECRET: supersecret | |
INSECURE_HOST: localhost:${{ job.services.insecure.ports['10000'] }} | |
- name: Annotate Test Suite Results | |
if: ${{ (success() || failure()) && hashFiles('gotestsum.json') != '' }} | |
uses: guyarb/golang-test-annotations@v0.8.0 | |
with: | |
test-results: gotestsum.json | |
- name: Upload coverage to Coveralls | |
uses: shogo82148/actions-goveralls@v1 | |
with: | |
path-to-profile: coverprofile |