31 lines
758 B
YAML
31 lines
758 B
YAML
name: "Build and Unit Test"
|
|
on: pull_request
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '1.17'
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ inputs.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: ${{ inputs.os }}-go-
|
|
|
|
- name: Build binary
|
|
run: go install ./cmd/litestream
|
|
|
|
- name: Run unit tests
|
|
run: make testdata && go test -v --coverprofile=.coverage.out ./... && go tool cover -html .coverage.out -o .coverage.html
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: code-coverage
|
|
path: .coverage.html
|