From 3ebc0de61f29479dff56c31f75a9c316b9ef03d8 Mon Sep 17 00:00:00 2001 From: surtur Date: Mon, 13 Jun 2022 13:27:55 +0200 Subject: [PATCH] ci: introduce 'drone-skip-pipeline' plugin expectations: * speed-up * resource preservation (don't needlessly run (full) builds when nothing pertinent changed) caveat: this does not (just yet) work with Gitea (a rewrite underway) [skip ci] --- .drone.starlark | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.drone.starlark b/.drone.starlark index 6511bad..75f42ec 100644 --- a/.drone.starlark +++ b/.drone.starlark @@ -7,14 +7,39 @@ def main(ctx): "kind": "pipeline", "type": "docker", "name": "golangci-lint", + "clone": {"disable": True}, "environment": { "GOPROXY": "direct" }, "steps": [ + { + "name": "skip-check", + "image": "docker.io/immawanderer/drone-skip-pipeline:linux-amd64", + "pull": "always", + "settings": { + "rules": [ + "*.go", + "*.sum", + "*.mod", + ".golangci.yml" + ] + }, + }, + { + "name": "clone", + "image": "docker.io/alpine/git", + "pull": "always", + "depends_on": ["skip-check"], + "commands": [ + "git clone ${DRONE_GIT_HTTP_URL} .", + "git checkout ${DRONE_COMMIT}" + ] + }, { "name": "golangci-lint", "image": "docker.io/immawanderer/archlinux-go-fyne:linux-amd64", "pull": "always", + "depends_on": ["clone"], "commands": [ "curl -sSfL " + "https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh"+