ci: make pipelines conditional

If only steps are conditional the whole CI workflow
will be held up waiting until a slot is available to start them
just to then not do anything at all.

This allows us to drop "when" condition from individual steps
whenever it is now redundant with the top-level condition.
This commit is contained in:
Oneric 2025-06-07 23:20:41 +02:00
parent 25da959772
commit c7b46e3799
4 changed files with 27 additions and 8 deletions

View file

@ -4,6 +4,14 @@ labels:
depends_on:
- test
when:
event:
- push
- tag
branch:
- develop
- stable
variables:
- &scw-secrets
SCW_ACCESS_KEY:
@ -42,7 +50,6 @@ steps:
# Canonical amd64
debian-bookworm:
image: hexpm/elixir:1.15.4-erlang-26.0.2-debian-bookworm-20230612
<<: *on-release
environment:
MIX_ENV: prod
DEBIAN_FRONTEND: noninteractive
@ -58,7 +65,6 @@ steps:
release-debian-bookworm:
image: akkoma/releaser
<<: *on-release
environment: *scw-secrets
commands:
- export SOURCE=akkoma-amd64.zip
@ -71,7 +77,6 @@ steps:
debian-bullseye:
image: hexpm/elixir:1.15.4-erlang-26.0.2-debian-bullseye-20230612
<<: *on-release
environment:
MIX_ENV: prod
DEBIAN_FRONTEND: noninteractive
@ -87,7 +92,6 @@ steps:
release-debian-bullseye:
image: akkoma/releaser
<<: *on-release
environment: *scw-secrets
commands:
- export SOURCE=akkoma-amd64-debian-bullseye.zip

View file

@ -4,6 +4,14 @@ labels:
depends_on:
- test
when:
event:
- push
- tag
branch:
- develop
- stable
variables:
- &scw-secrets
SCW_ACCESS_KEY:
@ -42,7 +50,6 @@ steps:
# Canonical arm64
debian-bookworm:
image: hexpm/elixir:1.15.4-erlang-26.0.2-debian-bookworm-20230612
<<: *on-release
environment:
MIX_ENV: prod
DEBIAN_FRONTEND: noninteractive
@ -58,7 +65,6 @@ steps:
release-debian-bookworm:
image: akkoma/releaser:arm64
<<: *on-release
environment: *scw-secrets
commands:
- export SOURCE=akkoma-arm64.zip

View file

@ -5,6 +5,13 @@ depends_on:
- test
- build-amd64
when:
event:
- push
branch:
- develop
- stable
variables:
- &setup-hex "mix local.hex --force && mix local.rebar --force"
- &on-release
@ -44,7 +51,6 @@ variables:
steps:
docs:
<<: *on-point-release
environment:
CI: "true"
SCW_ACCESS_KEY:

View file

@ -1,6 +1,10 @@
labels:
platform: linux/amd64
when:
event:
- pull_request
matrix:
# test the lowest and highest versions
include:
@ -62,7 +66,6 @@ services:
steps:
test:
image: akkoma/ci-base:${ELIXIR_VERSION}-otp${OTP_VERSION}
<<: *on-pr-open
environment:
MIX_ENV: test
POSTGRES_DB: pleroma_test_${ELIXIR_VERSION}_${OTP_VERSION}