new standalone Makefile and added staticcheck to github actions

This commit is contained in:
Christian Mouchet
2022-05-16 18:19:47 +02:00
committed by Jean-Philippe Bossuat
parent deb5bcfdfa
commit 76aee9decb
2 changed files with 27 additions and 17 deletions

View File

@@ -1,8 +1,9 @@
name: Go tests
name: CI Checks
on:
push:
jobs:
ci:
name: Go ${{ matrix.go }}
runs-on: ubuntu-latest
strategy:
@@ -11,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup go
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
@@ -26,5 +27,12 @@ jobs:
- name: Build
run: go build ./...
- name: Run tests
run: make ci_test
- name: Run staticcheck checks
uses: dominikh/staticcheck-action@v1.2.0
with:
version: "2022.1.1"
install-go: false
cache-key: ${{ matrix.go }}
- name: Run Makefile checks
run: make ci_tests

View File

@@ -1,7 +1,10 @@
.DEFAULT_GOAL := test
Coding/bin/Makefile.base:
git clone https://github.com/dedis/Coding
.PHONY: test_gotest
test_gotest:
go test -v -timeout=0 ./utils ./ring ./bfv ./ckks ./dbfv ./dckks
go test -v -timeout=0 ./ckks/advanced
go test -v -timeout=0 ./ckks/bootstrapping -test-bootstrapping -short
.PHONY: test_examples
test_examples:
@@ -19,18 +22,17 @@ test_examples:
go build -o /dev/null ./examples/ckks/advanced/rlwe_lwe_bridge_LHHMQ20
@echo ok
.PHONY: test_gotest
test_gotest:
go test -v -timeout=0 ./utils ./ring ./bfv ./ckks ./dbfv ./dckks
go test -v -timeout=0 ./ckks/advanced
go test -v -timeout=0 ./ckks/bootstrapping -test-bootstrapping -short
.PHONY: test_static_checks
test_static_checks:
@echo Checking correct formatting of files
out=`go fmt ./...`; echo "$$out"; [ -z "$$out" ]
go vet ./...
out=`golint ./...`; echo "$$out"; [ -z "$$out" ]
go mod tidy
out=`git status --porcelain`; echo "$$out"; [ -z "$$out" ]
.PHONY: test
test: test_fmt test_gotest test_examples
test: test_gotest test_examples
.PHONY: ci_test
ci_test: test_fmt test_lint test_gotest test_examples
%: force Coding/bin/Makefile.base
@$(MAKE) -f Coding/bin/Makefile.base $@
force: ;
ci_test: test_static_checks test_gotest test_examples