from only to rules

This commit is contained in:
Kay0u 2021-08-27 00:46:14 +02:00
parent d42123333c
commit 02c7a80775
No known key found for this signature in database
GPG key ID: AE1DCADB6415A156
5 changed files with 73 additions and 40 deletions

View file

@ -23,5 +23,5 @@ generate-helpers-doc:
artifacts: artifacts:
paths: paths:
- doc/helpers.md - doc/helpers.md
only: rules:
- tags - !reference [.on_tags_rules, rules]

View file

@ -45,6 +45,5 @@ format-run:
- git commit -am "[CI] Format code" || true - git commit -am "[CI] Format code" || true
- git push -f origin "ci-format-${CI_COMMIT_REF_NAME}":"ci-format-${CI_COMMIT_REF_NAME}" - git push -f origin "ci-format-${CI_COMMIT_REF_NAME}":"ci-format-${CI_COMMIT_REF_NAME}"
- hub pull-request -m "[CI] Format code" -b Yunohost:dev -p || true # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd - hub pull-request -m "[CI] Format code" -b Yunohost:dev -p || true # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd
only: rules:
refs: - !reference [.on_default_branch_rules, rules]
- dev

View file

@ -0,0 +1,7 @@
.on_default_branch_rules:
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
.on_tags_rules:
rules:
- if: $CI_COMMIT_TAG

View file

@ -54,24 +54,30 @@ test-i18n-keys:
extends: .test-stage extends: .test-stage
script: script:
- python3 -m pytest tests tests/test_i18n_keys.py - python3 -m pytest tests tests/test_i18n_keys.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- locales/* - locales/*
test-translation-format-consistency: test-translation-format-consistency:
extends: .test-stage extends: .test-stage
script: script:
- python3 -m pytest tests tests/test_translation_format_consistency.py - python3 -m pytest tests tests/test_translation_format_consistency.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- locales/* - locales/*
test-actionmap: test-actionmap:
extends: .test-stage extends: .test-stage
script: script:
- python3 -m pytest tests tests/test_actionmap.py - python3 -m pytest tests tests/test_actionmap.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- data/actionsmap/*.yml - data/actionsmap/*.yml
test-helpers: test-helpers:
@ -79,8 +85,10 @@ test-helpers:
script: script:
- cd tests - cd tests
- bash test_helpers.sh - bash test_helpers.sh
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- data/helpers.d/* - data/helpers.d/*
test-apps: test-apps:
@ -88,8 +96,10 @@ test-apps:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_apps.py - python3 -m pytest tests/test_apps.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/app.py - src/yunohost/app.py
test-appscatalog: test-appscatalog:
@ -97,8 +107,10 @@ test-appscatalog:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_appscatalog.py - python3 -m pytest tests/test_appscatalog.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/app.py - src/yunohost/app.py
test-appurl: test-appurl:
@ -106,8 +118,10 @@ test-appurl:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_appurl.py - python3 -m pytest tests/test_appurl.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/app.py - src/yunohost/app.py
test-apps-arguments-parsing: test-apps-arguments-parsing:
@ -115,8 +129,10 @@ test-apps-arguments-parsing:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_apps_arguments_parsing.py - python3 -m pytest tests/test_apps_arguments_parsing.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/app.py - src/yunohost/app.py
test-changeurl: test-changeurl:
@ -124,8 +140,10 @@ test-changeurl:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_changeurl.py - python3 -m pytest tests/test_changeurl.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/app.py - src/yunohost/app.py
test-backuprestore: test-backuprestore:
@ -133,8 +151,10 @@ test-backuprestore:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_backuprestore.py - python3 -m pytest tests/test_backuprestore.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/backup.py - src/yunohost/backup.py
test-permission: test-permission:
@ -142,8 +162,10 @@ test-permission:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_permission.py - python3 -m pytest tests/test_permission.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/permission.py - src/yunohost/permission.py
test-settings: test-settings:
@ -151,8 +173,10 @@ test-settings:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_settings.py - python3 -m pytest tests/test_settings.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/settings.py - src/yunohost/settings.py
test-user-group: test-user-group:
@ -160,8 +184,10 @@ test-user-group:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_user-group.py - python3 -m pytest tests/test_user-group.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/user.py - src/yunohost/user.py
test-regenconf: test-regenconf:
@ -169,8 +195,10 @@ test-regenconf:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_regenconf.py - python3 -m pytest tests/test_regenconf.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/regenconf.py - src/yunohost/regenconf.py
test-service: test-service:
@ -178,6 +206,8 @@ test-service:
script: script:
- cd src/yunohost - cd src/yunohost
- python3 -m pytest tests/test_service.py - python3 -m pytest tests/test_service.py
only: rules:
changes: - !reference [.on_default_branch_rules, rules]
- !reference [.on_tags_rules, rules]
- changes:
- src/yunohost/service.py - src/yunohost/service.py

View file

@ -20,8 +20,5 @@ remove-stale-translated-strings:
- git commit -am "[CI] Remove stale translated strings" || true - git commit -am "[CI] Remove stale translated strings" || true
- git push -f origin "ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}":"ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}" - git push -f origin "ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}":"ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}"
- hub pull-request -m "[CI] Remove stale translated strings" -b Yunohost:dev -p || true # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd - hub pull-request -m "[CI] Remove stale translated strings" -b Yunohost:dev -p || true # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd
only: rules:
variables: - !reference [.on_default_branch_rules, rules]
- $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
changes:
- locales/*