mirror of
https://github.com/moul/sshportal.git
synced 2025-09-10 22:54:49 +08:00
Merge pull request #187 from moul/dev/moul/maintenance
chore: repo maintenance 🤖
This commit is contained in:
commit
bbdb4851a5
2 changed files with 42 additions and 1 deletions
1
AUTHORS
1
AUTHORS
|
@ -7,6 +7,7 @@ Alexander Turner <me@alexturner.co>
|
||||||
bozzo <bozzo@users.noreply.github.com>
|
bozzo <bozzo@users.noreply.github.com>
|
||||||
fossabot <badges@fossa.io>
|
fossabot <badges@fossa.io>
|
||||||
Jean-Louis Férey <jeanlouis.ferey@orange.com>
|
Jean-Louis Férey <jeanlouis.ferey@orange.com>
|
||||||
|
jerard@alfa-safety.fr <jrrdev@users.noreply.github.com>
|
||||||
Jess <jessachandler@gmail.com>
|
Jess <jessachandler@gmail.com>
|
||||||
Jonathan Lestrelin <jonathan.lestrelin@gmail.com>
|
Jonathan Lestrelin <jonathan.lestrelin@gmail.com>
|
||||||
Julien Dessaux <julien.dessaux@adyxax.org>
|
Julien Dessaux <julien.dessaux@adyxax.org>
|
||||||
|
|
42
rules.mk
42
rules.mk
|
@ -72,14 +72,26 @@ GO_INSTALL_OPTS ?=
|
||||||
GO_TEST_OPTS ?= -test.timeout=30s
|
GO_TEST_OPTS ?= -test.timeout=30s
|
||||||
GOMOD_DIR ?= .
|
GOMOD_DIR ?= .
|
||||||
GOCOVERAGE_FILE ?= ./coverage.txt
|
GOCOVERAGE_FILE ?= ./coverage.txt
|
||||||
|
GOTESTJSON_FILE ?= ./go-test.json
|
||||||
|
GOBUILDLOG_FILE ?= ./go-build.log
|
||||||
|
GOINSTALLLOG_FILE ?= ./go-install.log
|
||||||
|
|
||||||
ifdef GOBINS
|
ifdef GOBINS
|
||||||
.PHONY: go.install
|
.PHONY: go.install
|
||||||
go.install:
|
go.install:
|
||||||
|
ifeq ($(CI),true)
|
||||||
|
@rm -f /tmp/goinstall.log
|
||||||
|
@set -e; for dir in $(GOBINS); do ( set -xe; \
|
||||||
|
cd $$dir; \
|
||||||
|
$(GO) install -v $(GO_INSTALL_OPTS) .; \
|
||||||
|
); done 2>&1 | tee $(GOINSTALLLOG_FILE)
|
||||||
|
|
||||||
|
else
|
||||||
@set -e; for dir in $(GOBINS); do ( set -xe; \
|
@set -e; for dir in $(GOBINS); do ( set -xe; \
|
||||||
cd $$dir; \
|
cd $$dir; \
|
||||||
$(GO) install $(GO_INSTALL_OPTS) .; \
|
$(GO) install $(GO_INSTALL_OPTS) .; \
|
||||||
); done
|
); done
|
||||||
|
endif
|
||||||
INSTALL_STEPS += go.install
|
INSTALL_STEPS += go.install
|
||||||
|
|
||||||
.PHONY: go.release
|
.PHONY: go.release
|
||||||
|
@ -92,15 +104,29 @@ endif
|
||||||
|
|
||||||
.PHONY: go.unittest
|
.PHONY: go.unittest
|
||||||
go.unittest:
|
go.unittest:
|
||||||
|
ifeq ($(CI),true)
|
||||||
|
@echo "mode: atomic" > /tmp/gocoverage
|
||||||
|
@rm -f $(GOTESTJSON_FILE)
|
||||||
|
@set -e; for dir in `find $(GOMOD_DIR) -type f -name "go.mod" | grep -v /vendor/ | sed 's@/[^/]*$$@@' | sort | uniq`; do (set -e; (set -euf pipefail; \
|
||||||
|
cd $$dir; \
|
||||||
|
($(GO) test ./... $(GO_TEST_OPTS) -cover -coverprofile=/tmp/profile.out -covermode=atomic -race -json | tee -a $(GOTESTJSON_FILE) 3>&1 1>&2 2>&3 | tee -a $(GOBUILDLOG_FILE); \
|
||||||
|
); \
|
||||||
|
if [ -f /tmp/profile.out ]; then \
|
||||||
|
cat /tmp/profile.out | sed "/mode: atomic/d" >> /tmp/gocoverage; \
|
||||||
|
rm -f /tmp/profile.out; \
|
||||||
|
fi)); done
|
||||||
|
@mv /tmp/gocoverage $(GOCOVERAGE_FILE)
|
||||||
|
else
|
||||||
@echo "mode: atomic" > /tmp/gocoverage
|
@echo "mode: atomic" > /tmp/gocoverage
|
||||||
@set -e; for dir in `find $(GOMOD_DIR) -type f -name "go.mod" | grep -v /vendor/ | sed 's@/[^/]*$$@@' | sort | uniq`; do (set -e; (set -xe; \
|
@set -e; for dir in `find $(GOMOD_DIR) -type f -name "go.mod" | grep -v /vendor/ | sed 's@/[^/]*$$@@' | sort | uniq`; do (set -e; (set -xe; \
|
||||||
cd $$dir; \
|
cd $$dir; \
|
||||||
$(GO) test $(GO_TEST_OPTS) -cover -coverprofile=/tmp/profile.out -covermode=atomic -race ./...); \
|
$(GO) test ./... $(GO_TEST_OPTS) -cover -coverprofile=/tmp/profile.out -covermode=atomic -race); \
|
||||||
if [ -f /tmp/profile.out ]; then \
|
if [ -f /tmp/profile.out ]; then \
|
||||||
cat /tmp/profile.out | sed "/mode: atomic/d" >> /tmp/gocoverage; \
|
cat /tmp/profile.out | sed "/mode: atomic/d" >> /tmp/gocoverage; \
|
||||||
rm -f /tmp/profile.out; \
|
rm -f /tmp/profile.out; \
|
||||||
fi); done
|
fi); done
|
||||||
@mv /tmp/gocoverage $(GOCOVERAGE_FILE)
|
@mv /tmp/gocoverage $(GOCOVERAGE_FILE)
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: go.checkdoc
|
.PHONY: go.checkdoc
|
||||||
go.checkdoc:
|
go.checkdoc:
|
||||||
|
@ -154,6 +180,20 @@ UNITTEST_STEPS += go.unittest
|
||||||
FMT_STEPS += go.fmt
|
FMT_STEPS += go.fmt
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
##
|
||||||
|
## Gitattributes
|
||||||
|
##
|
||||||
|
|
||||||
|
ifneq ($(wildcard .gitattributes),)
|
||||||
|
.PHONY: _linguist-ignored
|
||||||
|
_linguist-kept:
|
||||||
|
@git check-attr linguist-vendored $(shell git check-attr linguist-generated $(shell find . -type f | grep -v .git/) | grep unspecified | cut -d: -f1) | grep unspecified | cut -d: -f1 | sort
|
||||||
|
|
||||||
|
.PHONY: _linguist-kept
|
||||||
|
_linguist-ignored:
|
||||||
|
@git check-attr linguist-vendored linguist-ignored `find . -not -path './.git/*' -type f` | grep '\ set$$' | cut -d: -f1 | sort -u
|
||||||
|
endif
|
||||||
|
|
||||||
##
|
##
|
||||||
## Node
|
## Node
|
||||||
##
|
##
|
||||||
|
|
Loading…
Add table
Reference in a new issue