Skip to content

Build and test

Build and test #50

Workflow file for this run

name: Build and test
# on: [push]
on:
push:
branches:
- "main"
# branches-ignore: "dependabot/**"
# pull_request:
# paths-ignore:
# - "**.md"
schedule:
- cron: "0 6 * * 3"
jobs:
build-test-staticcheck:
name: Build, Test and Check
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.22"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: true
# - name: Restore Cache
# uses: actions/cache@v3
# id: cache
# with:
# path: ~/go/pkg
# key: 1.22-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.57
- name: Build
run: |
export PATH=${PATH}:`go env GOPATH`/bin
go build -v -o bin/
- name: Test
run: |
export PATH=${PATH}:`go env GOPATH`/bin
go test -v ./...