Use file filters action instead of Github's files filter (#24877)
Inspired by https://github.com/go-gitea/gitea/pull/24530#issuecomment-1558815301 This PR use a file filter action to do different CI jobs according changed files types. All types are defined in `.github/file-filters.yml`. Now there are 4 types, `docs`, `backend`, `frontend` and `build`. Then if a PR only changed docs files, those CI jobs which passed the conditions will run, and other types are also like this. --------- Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
d7e669c371
commit
93c6a9a652
12 changed files with 99 additions and 122 deletions
7
Makefile
7
Makefile
|
@ -35,6 +35,7 @@ SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.4
|
|||
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
|
||||
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0
|
||||
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@latest
|
||||
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@latest
|
||||
|
||||
DOCKER_IMAGE ?= gitea/gitea
|
||||
DOCKER_TAG ?= latest
|
||||
|
@ -199,6 +200,7 @@ help:
|
|||
@echo " - deps-tools install tool dependencies"
|
||||
@echo " - lint lint everything"
|
||||
@echo " - lint-fix lint everything and fix issues"
|
||||
@echo " - lint-actions lint action workflow files"
|
||||
@echo " - lint-frontend lint frontend files"
|
||||
@echo " - lint-frontend-fix lint frontend files and fix issues"
|
||||
@echo " - lint-backend lint backend files"
|
||||
|
@ -411,6 +413,10 @@ lint-go-vet:
|
|||
lint-editorconfig:
|
||||
$(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates .github/workflows
|
||||
|
||||
.PHONY: lint-actions
|
||||
lint-actions:
|
||||
$(GO) run $(ACTIONLINT_PACKAGE)
|
||||
|
||||
.PHONY: watch
|
||||
watch:
|
||||
@bash build/watch.sh
|
||||
|
@ -908,6 +914,7 @@ deps-tools:
|
|||
$(GO) install $(XGO_PACKAGE)
|
||||
$(GO) install $(GO_LICENSES_PACKAGE)
|
||||
$(GO) install $(GOVULNCHECK_PACKAGE)
|
||||
$(GO) install $(ACTIONLINT_PACKAGE)
|
||||
|
||||
node_modules: package-lock.json
|
||||
npm install --no-save
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue