Skip to content

Fix github actions

Fix github actions #39

Workflow file for this run

name: check code
on: [push]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.20', '1.21.x', '1.22.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- run: go version
- name: gofmt
run: |
set -e
out=$(gofmt -s -l *.go)
if [ -n "$out" ]; then
echo "All the following files are not correctly formatted"
echo $out
exit 1
fi
# TODO: should be reproducible build
# - name: go build
# run: |
# set -e
# sha1sum timefor
# go get
# go list -m all
# go build
# out=$(git status --porcelain)
# if [ -n "$out" ]; then
# echo 'Run "go build" and commit binary'
# echo $out
# sha1sum timefor
# exit 1
# fi
- run: go vet
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- run: go version
- name: test
run: go test -v