add test JWT token generation instructions #268
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: backend | |
on: | |
push: | |
branches: | |
tags: | |
paths: | |
- ".github/workflows/ci-test-backend.yml" | |
- "backend/**" | |
- "!backend/scripts/**" | |
- "!**.md" | |
pull_request: | |
types: [opened, reopened] | |
paths: | |
- ".github/workflows/ci-test-backend.yml" | |
- "backend/**" | |
- "!backend/scripts/**" | |
- "!**.md" | |
jobs: | |
test: | |
name: Test & Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: debug if needed | |
run: if [[ "$DEBUG" == "true" ]]; then env; fi | |
env: | |
DEBUG: ${{secrets.DEBUG}} | |
- name: install go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17 | |
- name: install golangci-lint and goveralls | |
run: | | |
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GITHUB_WORKSPACE v1.49.0 | |
go install github.com/mattn/goveralls@latest | |
- name: test and lint backend | |
run: | | |
go test -race -timeout=60s -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp ./... | |
cat $GITHUB_WORKSPACE/profile.cov_tmp | grep -v "_mock.go" > $GITHUB_WORKSPACE/profile.cov | |
$GITHUB_WORKSPACE/golangci-lint --config ${GITHUB_WORKSPACE}/backend/.golangci.yml run --out-format=github-actions ./... | |
working-directory: backend/app | |
env: | |
TZ: "America/Chicago" | |
- name: test and lint examples | |
run: | | |
go version | |
$GITHUB_WORKSPACE/golangci-lint version | |
go test -race ./... | |
$GITHUB_WORKSPACE/golangci-lint --config ${GITHUB_WORKSPACE}/backend/.golangci.yml run --out-format=github-actions ./... | |
working-directory: backend/_example/memory_store | |
env: | |
TZ: "America/Chicago" | |
- name: submit coverage | |
run: goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov | |
working-directory: backend | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |