Skip to content

.github: try latest Go version #275

.github: try latest Go version

.github: try latest Go version #275

Workflow file for this run

name: tests
on: [push, pull_request]
jobs:
test:
name: Build, lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
path: './src/github.com/kevinburke/rickover'
- uses: actions/setup-go@v3
with:
go-version: 1.21.x
# staticcheck needs this for GOPATH
- run: echo "GOPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- run: echo "PATH=$GITHUB_WORKSPACE/bin:$PATH" >> $GITHUB_ENV
- uses: actions/cache@master
with:
path: /go/bin
key: ${{ runner.os }}-gobin-v1-${{ hashFiles('**/Gopkg.lock') }}
restore-keys: |
${{ runner.os }}-gobin-v1-
- uses: actions/cache@master
with:
path: /github/home/.cache
key: ${{ runner.os }}-go-v1-${{ hashFiles('**/Gopkg.lock') }}
restore-keys: |
${{ runner.os }}-go-v1-
- name: install envdir
run: go install github.com/kevinburke/envdir@latest
- name: Start Postgres, install Goose, migrate database
working-directory: ./src/github.com/kevinburke/rickover
run: |
make goose
envdir envs/github make migrate-ci
- name: Lint
working-directory: ./src/github.com/kevinburke/rickover
run: |
make staticcheck
envdir envs/github make lint
- name: Test rickover
# github env has correct database URL
run: envdir envs/github go test -p=1 -race -timeout 10s ./...
working-directory: ./src/github.com/kevinburke/rickover
- name: Run benchmarks
run: envdir envs/github make benchmark-ci
working-directory: ./src/github.com/kevinburke/rickover