Skip to content

go-ci

go-ci #364

Workflow file for this run

name: go-ci
on:
push:
workflow_dispatch:
schedule:
- cron: "5 1 * * *"
jobs:
testing:
name: Test- and linting
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Run go fmt
if: runner.os != 'Windows'
run: diff -u <(echo -n) <(gofmt -d -s .)
- name: Run go vet
run: go vet ./...
- name: Run staticcheck
uses: dominikh/[email protected]
with:
version: "2023.1.2"
- name: Run go test
run: go test ./...
compile:
name: Compile application
runs-on: ubuntu-22.04
needs: [testing]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Download Go modules
run: go mod download
env:
GOPROXY: https://proxy.golang.org
- name: Build
run: go build -v
- name: Test
run: ./snab version