Skip to content

Fix lines starting with ? being incorrectly interpreted #289

Fix lines starting with ? being incorrectly interpreted

Fix lines starting with ? being incorrectly interpreted #289

Workflow file for this run

name: Build
on:
push:
pull_request:
jobs:
fmt:
name: gofmt
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run gofmt
run: ./.github/scripts/gofmt.sh
vet:
name: go vet
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: go-vet-${{ hashFiles('**/go.sum') }}
restore-keys: go-vet-
- name: Run go vet
run: ./.github/scripts/govet.sh
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
test:
name: go test
if: ${{ github.event_name != 'schedule' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: go-test-${{ hashFiles('**/go.sum') }}
restore-keys: go-test-
- name: Run go test
run: ./.github/scripts/gotest.sh
selftest:
name: self-test
if: ${{ github.event_name != 'schedule' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run self-test
run: |
set -euo pipefail
go test -json ./... 2>&1 | tee /tmp/gotest.log | go run ./cmd/gotestfmt -formatter "go run ./cmd/gotestfmt-formatter/main.go"
- name: Run self-test (verbose)
run: |
set -euo pipefail
go test -json -v ./... 2>&1 | tee /tmp/gotest-verbose.log | go run ./cmd/gotestfmt -formatter "go run ./cmd/gotestfmt-formatter/main.go"
- name: Upload test log
uses: actions/upload-artifact@v2
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error
release:
name: release
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
needs:
- fmt
- vet
- golangci-lint
- test
- selftest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: binaries
path: dist