Skip to content

basic run instructions #16

basic run instructions

basic run instructions #16

Workflow file for this run

name: code quality
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: ensure go mod tidy
run: go mod tidy && git diff --exit-code go.mod go.sum
- name: get linter version
id: linter-version
run: echo "version=$(grep 'LINTER_VERSION :=' Makefile | awk '{print $3}')" > $GITHUB_OUTPUT
- name: lint
uses: golangci/golangci-lint-action@v3
with:
version: v${{ steps.linter-version.outputs.version }}
args: --timeout=15m
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: test
run: go test -race -cover -short ./...
test-docker:
runs-on: ubuntu-latest
needs: [test]
services:
dind:
image: docker:24.0-dind-rootless
ports:
- 2375:2375
steps:
- uses: actions/checkout@v3
- name: set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: test
run: go test -race -cover ./...
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: build
run: make build
build-docker:
runs-on: ubuntu-latest
steps:
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: build
uses: docker/build-push-action@v4
with:
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest