diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c71d8933..066aa8ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file + - 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 diff --git a/Makefile b/Makefile index f0edc640..8f1e1e4b 100644 --- a/Makefile +++ b/Makefile @@ -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: ; \ No newline at end of file +ci_test: test_static_checks test_gotest test_examples \ No newline at end of file