diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86ace30d..8715d1e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,9 +9,14 @@ jobs: - uses: actions/checkout@v1 with: fetch-depth: 1 - - uses: dominikh/staticcheck-action@v1.2.0 - with: - version: "2022.1" + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: 1.17 + - name: Setup tools + run: make get_tools + - name: Run Makefile checks + run: make static_checks tests: name: Run Go ${{ matrix.go }} tests @@ -22,6 +27,7 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Setup Go uses: actions/setup-go@v1 with: @@ -38,4 +44,4 @@ jobs: run: go build ./... - name: Run Makefile checks - run: make ci_test + run: make test diff --git a/Makefile b/Makefile index 8f1e1e4b..6e4599c0 100644 --- a/Makefile +++ b/Makefile @@ -22,12 +22,13 @@ test_examples: go build -o /dev/null ./examples/ckks/advanced/rlwe_lwe_bridge_LHHMQ20 @echo ok -.PHONY: test_static_checks -test_static_checks: +.PHONY: static_checks +static_checks: @echo Checking correct formatting of files out=`go fmt ./...`; echo "$$out"; [ -z "$$out" ] go vet ./... out=`golint ./...`; echo "$$out"; [ -z "$$out" ] + staticcheck -go 1.17 ./... go mod tidy out=`git status --porcelain`; echo "$$out"; [ -z "$$out" ] @@ -35,4 +36,9 @@ test_static_checks: test: test_gotest test_examples .PHONY: ci_test -ci_test: test_static_checks test_gotest test_examples \ No newline at end of file +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 \ No newline at end of file