Skip to content

Merge pull request #28 from Ccheers/dev #158

Merge pull request #28 from Ccheers/dev

Merge pull request #28 from Ccheers/dev #158

Workflow file for this run

on: [push, pull_request]
name: Test
jobs:
test:
services:
etcd:
image: gcr.io/etcd-development/etcd:v3.5.0
ports:
- 2379:2379
env:
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
redis:
image: docker.io/redis:latest
ports:
- 6379:6379
strategy:
matrix:
go-version: [1.21.x, 1.22.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- name: Format
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
- name: Vet
run: "go vet ./..."
- name: Install Staticcheck
uses: dominikh/staticcheck-action@v1
with:
version: "latest"
install-go: false
cache-key: ${{ matrix.go-version }}
- name: Staticcheck
run: "staticcheck ./..."
- name: Test
run: "go test ./..."