mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
gitlab-ci: refactor to rules: and ditch old only: syntax
Adding workflow: is required, otherwise there would be duplicate pipelines for all users in the @fdroid group. There would be "branch pipelines" and "merge request pipelines". Confusingly, only jobs with rules: get duplicated.
This commit is contained in:
parent
07d499ce1f
commit
aa9cc14991
1 changed files with 49 additions and 47 deletions
|
|
@ -1,5 +1,16 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
|
# Use merge request pipelines when a merge request is open for the branch.
|
||||||
|
# Use branch pipelines when a merge request is not open for the branch.
|
||||||
|
# https://docs.gitlab.com/ci/yaml/workflow/#switch-between-branch-pipelines-and-merge-request-pipelines
|
||||||
|
workflow:
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||||
|
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
|
||||||
|
when: never
|
||||||
|
- if: $CI_COMMIT_BRANCH
|
||||||
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
pip: pip3 --timeout 100 --retries 10
|
pip: pip3 --timeout 100 --retries 10
|
||||||
# speed up git checkout phase
|
# speed up git checkout phase
|
||||||
|
|
@ -94,8 +105,8 @@ metadata_v0:
|
||||||
debian_testing:
|
debian_testing:
|
||||||
image: debian:testing
|
image: debian:testing
|
||||||
<<: *apt-template
|
<<: *apt-template
|
||||||
only:
|
rules:
|
||||||
- master@fdroid/fdroidserver
|
- if: $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "fdroid/fdroidserver"
|
||||||
script:
|
script:
|
||||||
- apt-get install
|
- apt-get install
|
||||||
aapt
|
aapt
|
||||||
|
|
@ -123,8 +134,8 @@ debian_testing:
|
||||||
ubuntu_lts_ppa:
|
ubuntu_lts_ppa:
|
||||||
image: ubuntu:latest
|
image: ubuntu:latest
|
||||||
<<: *apt-template
|
<<: *apt-template
|
||||||
only:
|
rules:
|
||||||
- master@fdroid/fdroidserver
|
- if: $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "fdroid/fdroidserver"
|
||||||
script:
|
script:
|
||||||
- export ANDROID_HOME=/usr/lib/android-sdk
|
- export ANDROID_HOME=/usr/lib/android-sdk
|
||||||
- apt-get install gnupg
|
- apt-get install gnupg
|
||||||
|
|
@ -188,8 +199,8 @@ ubuntu_jammy_pip:
|
||||||
gradlew-fdroid:
|
gradlew-fdroid:
|
||||||
image: debian:bookworm-slim
|
image: debian:bookworm-slim
|
||||||
<<: *apt-template
|
<<: *apt-template
|
||||||
only:
|
rules:
|
||||||
changes:
|
- changes:
|
||||||
- .gitlab-ci.yml
|
- .gitlab-ci.yml
|
||||||
- gradlew-fdroid
|
- gradlew-fdroid
|
||||||
- tests/test_gradlew-fdroid
|
- tests/test_gradlew-fdroid
|
||||||
|
|
@ -255,10 +266,7 @@ lint_format_bandit_checks:
|
||||||
safety:
|
safety:
|
||||||
image: debian:bookworm-slim
|
image: debian:bookworm-slim
|
||||||
rules:
|
rules:
|
||||||
# once only:/changes: are ported to rules:, this could be removed:
|
- if: $SAFETY_API_KEY
|
||||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
||||||
when: never
|
|
||||||
- if: $CI_PIPELINE_SOURCE == "push" && $SAFETY_API_KEY
|
|
||||||
changes:
|
changes:
|
||||||
- .gitlab-ci.yml
|
- .gitlab-ci.yml
|
||||||
- .safety-policy.yml
|
- .safety-policy.yml
|
||||||
|
|
@ -283,11 +291,7 @@ safety:
|
||||||
yamllint:
|
yamllint:
|
||||||
image: debian:bookworm-slim
|
image: debian:bookworm-slim
|
||||||
rules:
|
rules:
|
||||||
# once only:/changes: are ported to rules:, this could be removed:
|
- changes:
|
||||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
||||||
when: never
|
|
||||||
- if: $CI_PIPELINE_SOURCE == "push"
|
|
||||||
changes:
|
|
||||||
- .gitlab-ci.yml
|
- .gitlab-ci.yml
|
||||||
- .safety-policy.yml
|
- .safety-policy.yml
|
||||||
- .yamllint
|
- .yamllint
|
||||||
|
|
@ -308,7 +312,6 @@ yamllint:
|
||||||
tests/*/*/.*.yml
|
tests/*/*/.*.yml
|
||||||
|
|
||||||
|
|
||||||
# Run all the various linters and static analysis tools.
|
|
||||||
locales:
|
locales:
|
||||||
image: debian:bookworm-slim
|
image: debian:bookworm-slim
|
||||||
variables:
|
variables:
|
||||||
|
|
@ -380,8 +383,8 @@ fedora_latest:
|
||||||
macOS:
|
macOS:
|
||||||
tags:
|
tags:
|
||||||
- saas-macos-medium-m1
|
- saas-macos-medium-m1
|
||||||
only:
|
rules:
|
||||||
- master@fdroid/fdroidserver
|
- if: $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "fdroid/fdroidserver"
|
||||||
script:
|
script:
|
||||||
- export HOMEBREW_CURL_RETRIES=10
|
- export HOMEBREW_CURL_RETRIES=10
|
||||||
- brew update > /dev/null
|
- brew update > /dev/null
|
||||||
|
|
@ -446,8 +449,8 @@ gradle:
|
||||||
# Run an actual build in a simple, faked version of the buildserver guest VM.
|
# Run an actual build in a simple, faked version of the buildserver guest VM.
|
||||||
fdroid build:
|
fdroid build:
|
||||||
image: registry.gitlab.com/fdroid/fdroidserver:buildserver
|
image: registry.gitlab.com/fdroid/fdroidserver:buildserver
|
||||||
only:
|
rules:
|
||||||
changes:
|
- changes:
|
||||||
- .gitlab-ci.yml
|
- .gitlab-ci.yml
|
||||||
- fdroidserver/build.py
|
- fdroidserver/build.py
|
||||||
- fdroidserver/common.py
|
- fdroidserver/common.py
|
||||||
|
|
@ -516,8 +519,8 @@ fdroid build:
|
||||||
plugin_fetchsrclibs:
|
plugin_fetchsrclibs:
|
||||||
image: debian:bookworm-slim
|
image: debian:bookworm-slim
|
||||||
<<: *apt-template
|
<<: *apt-template
|
||||||
only:
|
rules:
|
||||||
changes:
|
- changes:
|
||||||
- .gitlab-ci.yml
|
- .gitlab-ci.yml
|
||||||
- examples/fdroid_fetchsrclibs.py
|
- examples/fdroid_fetchsrclibs.py
|
||||||
- fdroidserver/__main__.py
|
- fdroidserver/__main__.py
|
||||||
|
|
@ -560,8 +563,8 @@ plugin_fetchsrclibs:
|
||||||
servergitmirrors:
|
servergitmirrors:
|
||||||
image: debian:bookworm-slim
|
image: debian:bookworm-slim
|
||||||
<<: *apt-template
|
<<: *apt-template
|
||||||
only:
|
rules:
|
||||||
- master@fdroid/fdroidserver
|
- if: $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "fdroid/fdroidserver"
|
||||||
script:
|
script:
|
||||||
- apt-get install
|
- apt-get install
|
||||||
default-jdk-headless
|
default-jdk-headless
|
||||||
|
|
@ -622,8 +625,8 @@ Build documentation:
|
||||||
Windows:
|
Windows:
|
||||||
tags:
|
tags:
|
||||||
- windows
|
- windows
|
||||||
only:
|
rules:
|
||||||
- windows
|
- if: $CI_COMMIT_BRANCH == "windows"
|
||||||
script:
|
script:
|
||||||
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
|
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
|
||||||
- choco install --no-progress -y git --force --params "/GitAndUnixToolsOnPath"
|
- choco install --no-progress -y git --force --params "/GitAndUnixToolsOnPath"
|
||||||
|
|
@ -686,13 +689,12 @@ pages:
|
||||||
docker:
|
docker:
|
||||||
dependencies:
|
dependencies:
|
||||||
- fdroid build
|
- fdroid build
|
||||||
only:
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "fdroid/fdroidserver"
|
||||||
changes:
|
changes:
|
||||||
- .gitlab-ci.yml
|
- .gitlab-ci.yml
|
||||||
- makebuildserver
|
- makebuildserver
|
||||||
- buildserver/*
|
- buildserver/*
|
||||||
variables:
|
|
||||||
- $CI_COMMIT_BRANCH == "master" || $CI_PROJECT_NAMESPACE != "fdroid"
|
|
||||||
image: docker:dind
|
image: docker:dind
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue