switched to Makefile-based jobs

This commit is contained in:
Christian Mouchet
2022-05-17 13:31:06 +02:00
committed by Jean-Philippe Bossuat
parent 495cb4b1d5
commit 26a747a39d
2 changed files with 19 additions and 7 deletions

View File

@@ -9,9 +9,14 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
with: with:
fetch-depth: 1 fetch-depth: 1
- uses: dominikh/staticcheck-action@v1.2.0 - name: Setup Go
with: uses: actions/setup-go@v1
version: "2022.1" with:
go-version: 1.17
- name: Setup tools
run: make get_tools
- name: Run Makefile checks
run: make static_checks
tests: tests:
name: Run Go ${{ matrix.go }} tests name: Run Go ${{ matrix.go }} tests
@@ -22,6 +27,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v1 uses: actions/setup-go@v1
with: with:
@@ -38,4 +44,4 @@ jobs:
run: go build ./... run: go build ./...
- name: Run Makefile checks - name: Run Makefile checks
run: make ci_test run: make test

View File

@@ -22,12 +22,13 @@ test_examples:
go build -o /dev/null ./examples/ckks/advanced/rlwe_lwe_bridge_LHHMQ20 go build -o /dev/null ./examples/ckks/advanced/rlwe_lwe_bridge_LHHMQ20
@echo ok @echo ok
.PHONY: test_static_checks .PHONY: static_checks
test_static_checks: static_checks:
@echo Checking correct formatting of files @echo Checking correct formatting of files
out=`go fmt ./...`; echo "$$out"; [ -z "$$out" ] out=`go fmt ./...`; echo "$$out"; [ -z "$$out" ]
go vet ./... go vet ./...
out=`golint ./...`; echo "$$out"; [ -z "$$out" ] out=`golint ./...`; echo "$$out"; [ -z "$$out" ]
staticcheck -go 1.17 ./...
go mod tidy go mod tidy
out=`git status --porcelain`; echo "$$out"; [ -z "$$out" ] out=`git status --porcelain`; echo "$$out"; [ -z "$$out" ]
@@ -35,4 +36,9 @@ test_static_checks:
test: test_gotest test_examples test: test_gotest test_examples
.PHONY: ci_test .PHONY: ci_test
ci_test: test_static_checks test_gotest test_examples ci_test: static_checks test_gotest test_examples
.PHONY: get_tools
get_tools:
go install golang.org/x/lint/golint@latest
go install honnef.co/go/tools/cmd/staticcheck@2022.1.1