Skip to content

Creating metrics from log messages. #142

Creating metrics from log messages.

Creating metrics from log messages. #142

Workflow file for this run

name: Tests
permissions: read-all
on:
push:
branches: [ primary ]
tags: [ 'v*.*.*' ]
pull_request:
workflow_dispatch: # Allow manual runs to kick off benchmarks
inputs:
run_bench:
description: Run benchmarks
required: false
type: boolean
env:
GO_VERSION: 1.21
jobs:
code-quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Determine paths to cache
id: cache
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)">> $GITHUB_OUTPUT
- name: Go Build Cache
uses: actions/cache@v3
with:
path: |
${{ steps.cache.outputs.go-build }}
${{ steps.cache.outputs.go-mod }}
key: ${{ runner.os }}-quality-${{ hashFiles('**/go.sum') }}
# This action should, in general, be a no-op, given the cache above.
- name: Download all deps
run: go mod download
- name: crlfmt returns no deltas
if: ${{ always() }}
run: |
DELTA=$(go run github.com/cockroachdb/crlfmt .)
echo $DELTA
test -z "$DELTA"
- name: Lint
if: ${{ always() }}
run: go run golang.org/x/lint/golint -set_exit_status ./...
- name: Static checks
if: ${{ always() }}
run: go run honnef.co/go/tools/cmd/staticcheck -checks all ./...
run-tests:
name: Run tests
runs-on: ubuntu-latest
env:
COVER_OUT: coverage.out
steps:
- uses: actions/checkout@v3
- name: et up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Determine paths to cache
id: cache
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)">> $GITHUB_OUTPUT
- name: Go Build Cache
uses: actions/cache@v3
with:
path: |
${{ steps.cache.outputs.go-build }}
${{ steps.cache.outputs.go-mod }}
key: ${{ runner.os }}-integration-${{ hashFiles('**/go.sum') }}
- name: Go Tests
run: go test -v -race -coverpkg=./internal/... -covermode=atomic -coverprofile=${{ env.COVER_OUT }} ./...