forked from TrueCloudLab/certificates
Merge pull request #474 from smallstep/cgo-or-not-cgo
Permit linting and testing without CGO support.
This commit is contained in:
commit
4745be2309
5 changed files with 15 additions and 7 deletions
|
@ -18,7 +18,7 @@ env:
|
||||||
before_script:
|
before_script:
|
||||||
- make bootstrap
|
- make bootstrap
|
||||||
script:
|
script:
|
||||||
- make
|
- make travis
|
||||||
- make artifacts
|
- make artifacts
|
||||||
after_success:
|
after_success:
|
||||||
- bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" || echo "Codecov did
|
- bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" || echo "Codecov did
|
||||||
|
|
14
Makefile
14
Makefile
|
@ -18,7 +18,9 @@ OUTPUT_ROOT=output/
|
||||||
|
|
||||||
all: lint test build
|
all: lint test build
|
||||||
|
|
||||||
.PHONY: all
|
travis: lintcgo testcgo build
|
||||||
|
|
||||||
|
.PHONY: all travis
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
# Bootstrapping
|
# Bootstrapping
|
||||||
|
@ -119,9 +121,12 @@ generate:
|
||||||
# Test
|
# Test
|
||||||
#########################################
|
#########################################
|
||||||
test:
|
test:
|
||||||
|
$Q $(GOFLAGS) go test -short -coverprofile=coverage.out ./...
|
||||||
|
|
||||||
|
testcgo:
|
||||||
$Q go test -short -coverprofile=coverage.out ./...
|
$Q go test -short -coverprofile=coverage.out ./...
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test testcgo
|
||||||
|
|
||||||
integrate: integration
|
integrate: integration
|
||||||
|
|
||||||
|
@ -138,9 +143,12 @@ fmt:
|
||||||
$Q gofmt -l -w $(SRC)
|
$Q gofmt -l -w $(SRC)
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
|
$Q $(GOFLAGS) LOG_LEVEL=error golangci-lint run --timeout=30m
|
||||||
|
|
||||||
|
lintcgo:
|
||||||
$Q LOG_LEVEL=error golangci-lint run --timeout=30m
|
$Q LOG_LEVEL=error golangci-lint run --timeout=30m
|
||||||
|
|
||||||
.PHONY: lint fmt
|
.PHONY: fmt lint lintcgo
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
# Install
|
# Install
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !softhsm2,!yubihsm2,!opensc
|
// +build cgo,!softhsm2,!yubihsm2,!opensc
|
||||||
|
|
||||||
package pkcs11
|
package pkcs11
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build softhsm2
|
// +build cgo,softhsm2
|
||||||
|
|
||||||
package pkcs11
|
package pkcs11
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build yubihsm2
|
// +build cgo,yubihsm2
|
||||||
|
|
||||||
package pkcs11
|
package pkcs11
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue