🍽 Fork YunoHost — snapshot mangé par la machine à tsoins
Upstream: https://github.com/YunoHost/yunohost @ 3a5f8bac8301c450897b96cbd43a4c7d3ba750fb But (José) : transformer tout le code en bions + ploxions du xerboxion. La carte de digestion vit au labo : /yunohost-digest.json
This commit is contained in:
42
.gitlab/ci/bot.gitlab-ci.yml
Normal file
42
.gitlab/ci/bot.gitlab-ci.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
generate-helpers-doc:
|
||||
stage: bot
|
||||
image: "build-and-lint"
|
||||
needs: []
|
||||
before_script:
|
||||
- git config --global user.email "yunohost@yunohost.org"
|
||||
- git config --global user.name "$GITHUB_USER"
|
||||
script:
|
||||
- hub clone https://$GITHUB_TOKEN:x-oauth-basic@github.com/YunoHost/doc.git doc_repo
|
||||
- doc_repo/scripts/generate_docs.sh "$PWD"
|
||||
|
||||
- cd doc_repo
|
||||
# replace ${CI_COMMIT_REF_NAME} with ${CI_COMMIT_TAG} ?
|
||||
- hub checkout -b "${CI_COMMIT_REF_NAME}"
|
||||
- hub commit -am "[CI] Update app helpers/resources for ${CI_COMMIT_REF_NAME}"
|
||||
- hub pull-request -m "[CI] Update app helpers/resources for ${CI_COMMIT_REF_NAME}" -p # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd
|
||||
only:
|
||||
- tags
|
||||
|
||||
autofix-translated-strings:
|
||||
stage: bot
|
||||
image: "build-and-lint"
|
||||
needs: []
|
||||
before_script:
|
||||
- git config --global user.email "yunohost@yunohost.org"
|
||||
- git config --global user.name "$GITHUB_USER"
|
||||
- hub clone --branch ${CI_COMMIT_REF_NAME} "https://$GITHUB_TOKEN:x-oauth-basic@github.com/YunoHost/yunohost.git" github_repo
|
||||
- cd github_repo
|
||||
script:
|
||||
# create a local branch that will overwrite distant one
|
||||
- git checkout -b "ci-autofix-translated-strings-${CI_COMMIT_REF_NAME}" --no-track
|
||||
- python3 maintenance/missing_i18n_keys.py fix
|
||||
- python3 maintenance/autofix_locale_format.py
|
||||
- '[ $(git diff --ignore-blank-lines --ignore-all-space --ignore-space-at-eol --ignore-cr-at-eol | wc -l) != 0 ] || exit 0' # stop if there is nothing to commit
|
||||
- git commit -am "[CI] Reformat / remove stale translated strings" || true
|
||||
- git push -f origin "ci-autofix-translated-strings-${CI_COMMIT_REF_NAME}":"ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}"
|
||||
- hub pull-request -m "[CI] Reformat / remove stale translated strings" -b Yunohost:$CI_COMMIT_REF_NAME -p || true # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
||||
changes:
|
||||
- locales/*
|
||||
58
.gitlab/ci/build.gitlab-ci.yml
Normal file
58
.gitlab/ci/build.gitlab-ci.yml
Normal file
@@ -0,0 +1,58 @@
|
||||
.build-stage:
|
||||
stage: build
|
||||
needs:
|
||||
- job: actionsmap
|
||||
- job: invalidcode311
|
||||
image: "build-and-lint"
|
||||
variables:
|
||||
YNH_BUILD_DIR: "$GIT_CLONE_PATH/build"
|
||||
before_script:
|
||||
- echo $PWD
|
||||
- echo $CI_PROJECT_DIR
|
||||
- mkdir -p $YNH_BUILD_DIR
|
||||
artifacts:
|
||||
paths:
|
||||
- ./*.deb
|
||||
|
||||
.build_script: &build_script
|
||||
- cd $YNH_BUILD_DIR/$PACKAGE
|
||||
- VERSION=$(dpkg-parsechangelog -S Version 2>/dev/null)
|
||||
- VERSION_TIMESTAMPED="${VERSION}+$(date +%Y%m%d%H%M)"
|
||||
- dch --package "${PACKAGE}" --force-bad-version -v "${VERSION_TIMESTAMPED}" -D "unstable" --force-distribution "CI build."
|
||||
- debuild --no-lintian -us -uc
|
||||
- cp $YNH_BUILD_DIR/*.deb ${CI_PROJECT_DIR}/
|
||||
- cd ${CI_PROJECT_DIR}
|
||||
|
||||
########################################
|
||||
# BUILD DEB
|
||||
########################################
|
||||
|
||||
build-yunohost:
|
||||
extends: .build-stage
|
||||
variables:
|
||||
PACKAGE: "yunohost"
|
||||
script:
|
||||
- git ls-files | xargs tar -czf archive.tar.gz
|
||||
- mkdir -p $YNH_BUILD_DIR/$PACKAGE
|
||||
- cat archive.tar.gz | tar -xz -C $YNH_BUILD_DIR/$PACKAGE
|
||||
- rm archive.tar.gz
|
||||
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE || { apt-get update && DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE; }
|
||||
- *build_script
|
||||
|
||||
build-ssowat:
|
||||
extends: .build-stage
|
||||
variables:
|
||||
PACKAGE: "ssowat"
|
||||
script:
|
||||
- git clone $YNH_SOURCE/$PACKAGE -b $CI_COMMIT_REF_NAME $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE -b $YNH_DEBIAN $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE $YNH_BUILD_DIR/$PACKAGE --depth 1
|
||||
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE || { apt-get update && DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE; }
|
||||
- *build_script
|
||||
|
||||
build-moulinette:
|
||||
extends: .build-stage
|
||||
variables:
|
||||
PACKAGE: "moulinette"
|
||||
script:
|
||||
- git clone $YNH_SOURCE/$PACKAGE -b $CI_COMMIT_REF_NAME $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE -b $YNH_DEBIAN $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE $YNH_BUILD_DIR/$PACKAGE --depth 1
|
||||
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE || { apt-get update && DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE; }
|
||||
- *build_script
|
||||
29
.gitlab/ci/install.gitlab-ci.yml
Normal file
29
.gitlab/ci/install.gitlab-ci.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
.install-stage:
|
||||
stage: install
|
||||
needs:
|
||||
- job: build-yunohost
|
||||
artifacts: true
|
||||
- job: build-ssowat
|
||||
artifacts: true
|
||||
- job: build-moulinette
|
||||
artifacts: true
|
||||
|
||||
########################################
|
||||
# INSTALL DEB
|
||||
########################################
|
||||
|
||||
upgrade:
|
||||
extends: .install-stage
|
||||
image: "core-tests"
|
||||
script:
|
||||
- apt update
|
||||
- DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt --assume-yes -o Dpkg::Options::="--force-confold" --allow-downgrades install ${CI_PROJECT_DIR}/*.deb
|
||||
|
||||
|
||||
install-postinstall:
|
||||
extends: .install-stage
|
||||
image: "before-install"
|
||||
script:
|
||||
- apt update
|
||||
- DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt --assume-yes -o Dpkg::Options::="--force-confold" --allow-downgrades install ${CI_PROJECT_DIR}/*.deb
|
||||
- yunohost tools postinstall -d domain.tld -u syssa -F 'Syssa Mine' -p the_password --ignore-dyndns --force-diskspace
|
||||
41
.gitlab/ci/lint.gitlab-ci.yml
Normal file
41
.gitlab/ci/lint.gitlab-ci.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
########################################
|
||||
# LINTER
|
||||
########################################
|
||||
# later we must fix lint and format-check jobs and remove "allow_failure"
|
||||
|
||||
actionsmap:
|
||||
stage: lint
|
||||
image: "build-and-lint"
|
||||
needs: []
|
||||
script:
|
||||
- python3 -c 'import yaml; yaml.safe_load(open("share/actionsmap.yml"))'
|
||||
- python3 -c 'import yaml; yaml.safe_load(open("share/actionsmap-portal.yml"))'
|
||||
|
||||
lint311:
|
||||
stage: lint
|
||||
image: "build-and-lint"
|
||||
needs: []
|
||||
allow_failure: true
|
||||
script:
|
||||
- tox -e py311-lint
|
||||
|
||||
invalidcode311:
|
||||
stage: lint
|
||||
image: "build-and-lint"
|
||||
needs: []
|
||||
script:
|
||||
- tox -e py311-invalidcode
|
||||
|
||||
mypy:
|
||||
stage: lint
|
||||
image: "build-and-lint"
|
||||
needs: []
|
||||
script:
|
||||
- tox -e py311-mypy
|
||||
|
||||
i18n-keys:
|
||||
stage: lint
|
||||
image: "build-and-lint"
|
||||
needs: []
|
||||
script:
|
||||
- python3 maintenance/missing_i18n_keys.py check
|
||||
187
.gitlab/ci/test.gitlab-ci.yml
Normal file
187
.gitlab/ci/test.gitlab-ci.yml
Normal file
@@ -0,0 +1,187 @@
|
||||
.install_debs: &install_debs
|
||||
# Temporary hack for the CI to install python3-zmq not yet in the image
|
||||
- DEBIAN_FRONTEND=noninteractive apt update
|
||||
- DEBIAN_FRONTEND=noninteractive apt --assume-yes install python3-zmq
|
||||
- DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt --assume-yes -o Dpkg::Options::="--force-confold" --allow-downgrades install ${CI_PROJECT_DIR}/*.deb
|
||||
|
||||
.test-stage:
|
||||
stage: test
|
||||
image: "core-tests"
|
||||
variables:
|
||||
#PYTEST_ADDOPTS: "--color=yes --cov=src"
|
||||
PYTEST_ADDOPTS: "--color=yes"
|
||||
COVERAGE_FILE: ".coverage_$CI_JOB_NAME"
|
||||
before_script:
|
||||
- *install_debs
|
||||
- ln -s src yunohost
|
||||
needs:
|
||||
- job: build-yunohost
|
||||
artifacts: true
|
||||
- job: build-ssowat
|
||||
artifacts: true
|
||||
- job: build-moulinette
|
||||
artifacts: true
|
||||
- job: upgrade
|
||||
artifacts:
|
||||
paths:
|
||||
- ./.coverage_*
|
||||
|
||||
########################################
|
||||
# TESTS
|
||||
########################################
|
||||
|
||||
.test-pytest:
|
||||
extends: .test-stage
|
||||
script:
|
||||
- python3 -m pytest $TEST_FILE --durations=50
|
||||
|
||||
test-helpers:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_helpers.py
|
||||
|
||||
test-domains:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_domains.py
|
||||
|
||||
test-dns:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_dns.py
|
||||
|
||||
test-apps:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_apps.py
|
||||
|
||||
test-appscatalog:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_app_catalog.py
|
||||
|
||||
test-appurl:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_appurl.py
|
||||
|
||||
test-questions:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_questions.py
|
||||
|
||||
test-app-config:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_app_config.py
|
||||
|
||||
test-app-resources:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_app_resources.py
|
||||
|
||||
test-changeurl:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_changeurl.py
|
||||
|
||||
test-backuprestore:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_backuprestore.py
|
||||
|
||||
test-permission:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_permission.py
|
||||
|
||||
test-settings:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_settings.py
|
||||
|
||||
test-user-group:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_user-group.py
|
||||
|
||||
test-regenconf:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_regenconf.py
|
||||
|
||||
test-service:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_service.py
|
||||
|
||||
test-ldapauth:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_ldapauth.py
|
||||
|
||||
test-sso-and-portalapi:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_sso_and_portalapi.py
|
||||
|
||||
test-process:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_process.py
|
||||
|
||||
test-file-utils:
|
||||
extends: .test-pytest
|
||||
variables:
|
||||
TEST_FILE: tests/test_file_utils.py
|
||||
|
||||
########################################
|
||||
# COVERAGE REPORT
|
||||
########################################
|
||||
|
||||
#coverage:
|
||||
# stage: test
|
||||
# image: "core-tests"
|
||||
# needs:
|
||||
# # Yeah ... gotta list all of those individually ... https://gitlab.com/gitlab-org/gitlab/-/issues/332326
|
||||
# - job: test-domains
|
||||
# artifacts: true
|
||||
# - job: test-dns
|
||||
# artifacts: true
|
||||
# - job: test-apps
|
||||
# artifacts: true
|
||||
# - job: test-appscatalog
|
||||
# artifacts: true
|
||||
# - job: test-appurl
|
||||
# artifacts: true
|
||||
# - job: test-questions
|
||||
# artifacts: true
|
||||
# - job: test-app-config
|
||||
# artifacts: true
|
||||
# - job: test-app-resources
|
||||
# artifacts: true
|
||||
# - job: test-changeurl
|
||||
# artifacts: true
|
||||
# - job: test-backuprestore
|
||||
# artifacts: true
|
||||
# - job: test-permission
|
||||
# artifacts: true
|
||||
# - job: test-settings
|
||||
# artifacts: true
|
||||
# - job: test-user-group
|
||||
# artifacts: true
|
||||
# - job: test-regenconf
|
||||
# artifacts: true
|
||||
# - job: test-service
|
||||
# artifacts: true
|
||||
# - job: test-ldapauth
|
||||
# artifacts: true
|
||||
# - job: test-sso-and-portalapi
|
||||
# artifacts: true
|
||||
# - job: test-process
|
||||
# artifacts: true
|
||||
# - job: test-file-utils
|
||||
# artifacts: true
|
||||
# script:
|
||||
# - coverage combine ./.coverage_*
|
||||
# - coverage report
|
||||
Reference in New Issue
Block a user