ci: use make to build and run tests/check
This commit is contained in:
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "### Running gofmt..."
|
|
||||||
files="$(gofmt -l .)"
|
|
||||||
|
|
||||||
if [ ! -z "$files" ]; then
|
|
||||||
# run gofmt to print out the diff of what needs to be changed
|
|
||||||
gofmt -d -e .
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "### Running staticcheck..."
|
|
||||||
staticcheck ./...
|
|
@@ -24,25 +24,13 @@ stages:
|
|||||||
- merge_requests
|
- merge_requests
|
||||||
- tags
|
- tags
|
||||||
|
|
||||||
# device documentation
|
|
||||||
gofmt linting:
|
|
||||||
stage: lint
|
|
||||||
allow_failure: true
|
|
||||||
<<: *only-default
|
|
||||||
before_script:
|
|
||||||
# specific mirror used because staticcheck hasn't made it to the other mirrors yet...
|
|
||||||
- apk -q update --repository http://dl-4.alpinelinux.org/alpine/edge/testing
|
|
||||||
- apk -q add --repository http://dl-4.alpinelinux.org/alpine/edge/testing go staticcheck
|
|
||||||
script:
|
|
||||||
- .ci/check_linting.sh
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
<<: *only-default
|
<<: *only-default
|
||||||
before_script:
|
before_script:
|
||||||
- apk -q add go
|
- apk -q add go staticcheck make
|
||||||
script:
|
script:
|
||||||
- go build -v
|
- make test
|
||||||
- go test ./...
|
- make
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
Reference in New Issue
Block a user