Commit 55fa066e authored by Laurent Peuch's avatar Laurent Peuch
Browse files

ci: backport rules because only/except is broken

--HG--
branch : 3.27
parent b02220ba7801
image: python:latest
# avoid duplicated pipelines
# see: https://docs.gitlab.com/ee/ci/yaml/#switch-between-branch-pipelines-and-merge-request-pipelines
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_REF_NAME =~ /^topic\/.*/'
when: never
- when: always
stages:
- lint
- tests
......@@ -8,9 +17,11 @@ stages:
- deploy
lint_py:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
rules:
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
when: never
- changes:
- "**/*.py"
stage: lint
before_script:
- pip install tox
......@@ -19,9 +30,10 @@ lint_py:
allow_failure: true # XXX fix me
lint_manifest:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
rules:
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
when: never
- when: on_success
stage: lint
before_script:
- pip install tox
......@@ -29,12 +41,11 @@ lint_manifest:
- tox -e check-manifest
lint_doc8:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
only:
changes:
- doc/**/*
rules:
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
when: never
- changes:
- doc/**/*
stage: lint
before_script:
- pip install tox
......@@ -42,13 +53,12 @@ lint_doc8:
- tox -e doc8
build_doc:
only:
changes:
- doc/**/*
- "**/*.py"
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
rules:
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
when: never
- changes:
- doc/**/*
- "**/*.py"
stage: lint
before_script:
- pip install tox
......@@ -57,12 +67,17 @@ build_doc:
artifacts:
paths:
- .tox/doc/tmp/html
allow_failure: true # XXX fix me
allow_failure: true # XXX fix me
py3_server:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
rules:
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
when: never
- changes:
- cubicweb/**/*
- "*.py" # setup.py
- requirements/dev.txt
- requirements/test-server.txt
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
before_script:
......@@ -77,9 +92,14 @@ py3_server:
- /reports/coverage-server.xml
py3_web:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
rules:
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
when: never
- changes:
- cubicweb/**/*
- "*.py" # setup.py
- requirements/dev.txt
- requirements/test-web.txt
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
before_script:
......@@ -93,9 +113,14 @@ py3_web:
- /reports/coverage-web.xml
py3_misc:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
rules:
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
when: never
- changes:
- cubicweb/**/*
- "*.py" # setup.py
- requirements/dev.txt
- requirements/test-misc.txt
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
before_script:
......@@ -109,9 +134,14 @@ py3_misc:
- /reports/coverage-misc.xml
py3-from-forge-server:
only:
changes:
- cubicweb/**/*
rules:
- changes:
- cubicweb/**/*
- "*.py" # setup.py
- requirements/from-forge.txt
- requirements/dev.txt
- requirements/test-server.txt
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
allow_failure: true
......@@ -126,9 +156,14 @@ py3-from-forge-server:
- tox -e py3-from-forge-server
py3-from-forge-web:
only:
changes:
- cubicweb/**/*
rules:
- changes:
- cubicweb/**/*
- "*.py" # setup.py
- requirements/from-forge.txt
- requirements/dev.txt
- requirements/test-web.txt
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
allow_failure: true
......@@ -142,9 +177,14 @@ py3-from-forge-web:
- /builds/cubicweb/cubicweb/py3-from-forge-web-deprecated-warnings.json
py3-from-forge-misc:
only:
changes:
- cubicweb/**/*
rules:
- changes:
- cubicweb/**/*
- "*.py" # setup.py
- requirements/from-forge.txt
- requirements/dev.txt
- requirements/test-misc.txt
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
allow_failure: true
......@@ -158,28 +198,25 @@ py3-from-forge-misc:
- /builds/cubicweb/cubicweb/py3-from-forge-misc-deprecated-warnings.json
trigger-readthedocs:
only:
refs:
- branch/default
changes:
- cubicweb/**/*
- doc/**/*
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
rules:
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
when: never
- if: '$CI_COMMIT_REF_NAME == "branch/default"'
changes:
- cubicweb/**/*
- doc/**/*
stage: after-tests
script:
# regarding the " everywhere when there is a '%': yaml is extremly weird when % are involved
- curl -X POST -d "token=${READTHEDOCS_TOKEN}" https://readthedocs.org/api/v2/webhook/cubicweb/33537/ -w "\nhttp code:"\ "%{http_code}\n" -f
# regarding the " everywhere when there is a '%': yaml is extremly weird when % are involved
- curl -X POST -d "token=${READTHEDOCS_TOKEN}" https://readthedocs.org/api/v2/webhook/cubicweb/33537/ -w "\nhttp code:"\ "%{http_code}\n" -f
sonarqube:
stage: qa
image: sonarsource/sonar-scanner-cli
only:
- branch/default
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
rules:
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
when: never
- if: '$CI_COMMIT_REF_NAME == "branch/default"'
script:
- apk add python3 mercurial
- sonar-scanner
......@@ -194,9 +231,10 @@ sonarqube:
pages:
stage: deploy
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
rules:
- if: '$TRIGGERED_FROM_OTHER_PROJECT'
when: never
- if: '$CI_COMMIT_REF_NAME == "branch/default"'
before_script:
- pip install tox
script:
......@@ -209,5 +247,3 @@ pages:
artifacts:
paths:
- public
only:
- branch/default
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment