From 68825a17272224efca0a15544cf7608fe0429272 Mon Sep 17 00:00:00 2001 From: crapStone Date: Tue, 23 Jul 2024 20:32:46 +0000 Subject: [PATCH] improve pipeline config (#371) Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/371 Co-authored-by: crapStone Co-committed-by: crapStone --- .woodpecker/build.yml | 35 ++++++++--------------------------- .woodpecker/lint.yml | 14 -------------- 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml index a00b7d6..9bf20f9 100644 --- a/.woodpecker/build.yml +++ b/.woodpecker/build.yml @@ -1,9 +1,6 @@ when: - - event: [pull_request, tag, cron] - - event: push - branch: - - ${CI_REPO_DEFAULT_BRANCH} - - renovate/* + - event: [push, pull_request, tag, cron] + branch: ${CI_REPO_DEFAULT_BRANCH} depends_on: - lint @@ -24,9 +21,6 @@ steps: - just build when: - event: [push, pull_request] - branch: - - ${CI_REPO_DEFAULT_BRANCH} - - renovate/* docker-dryrun: depends_on: vendor @@ -38,9 +32,6 @@ steps: tags: latest when: - event: [push, pull_request] - branch: - - ${CI_REPO_DEFAULT_BRANCH} - - renovate/* path: Dockerfile build-tag: @@ -51,9 +42,7 @@ steps: - go version - just build-tag ${CI_COMMIT_TAG##v} when: - - event: ['tag'] - branch: - - ${CI_REPO_DEFAULT_BRANCH} + - event: [tag] test: depends_on: build @@ -62,9 +51,7 @@ steps: commands: - just test when: - - event: pull_request - - event: push - branch: renovate/* + - event: [push, pull_request] integration-tests: depends_on: build @@ -78,9 +65,7 @@ steps: - RAW_DOMAIN=raw.localhost.mock.directory - PORT=4430 when: - - event: pull_request - - event: push - branch: renovate/* + - event: [push, pull_request] release: depends_on: build @@ -92,9 +77,7 @@ steps: api_key: from_secret: bot_token when: - - event: ['tag'] - branch: - - ${CI_REPO_DEFAULT_BRANCH} + - event: [tag] docker-next: depends_on: vendor @@ -110,8 +93,7 @@ steps: password: from_secret: bot_token when: - - event: ['push'] - branch: ${CI_REPO_DEFAULT_BRANCH} + - event: [push] 'Publish PR image': image: woodpeckerci/plugin-docker-buildx:4.2.0 @@ -144,5 +126,4 @@ steps: password: from_secret: bot_token when: - - event: ['push'] - branch: ${CI_REPO_DEFAULT_BRANCH} + - event: [push] diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml index 0e3df1d..5699a0a 100644 --- a/.woodpecker/lint.yml +++ b/.woodpecker/lint.yml @@ -1,9 +1,7 @@ when: - event: pull_request - - event: push branch: - ${CI_REPO_DEFAULT_BRANCH} - - renovate/** steps: lint: @@ -14,28 +12,16 @@ steps: - go install mvdan.cc/gofumpt@latest - "[ $(gofumpt -extra -l . | wc -l) != 0 ] && { echo 'code not formated'; exit 1; }" - golangci-lint run --timeout 5m --build-tags integration - when: - - event: pull_request - - event: push - branch: renovate/* editor-config: depends_on: [] image: mstruebing/editorconfig-checker:v3.0.3 - when: - - event: pull_request - - event: push - branch: renovate/* yamllint: image: pipelinecomponents/yamllint:0.31.3 depends_on: [] commands: - yamllint . - when: - - event: pull_request - - event: push - branch: renovate/* prettier: image: docker.io/woodpeckerci/plugin-prettier:0.1.0