ci: tweaks to try to run build/lints into a 'permanent' container (not recreated every time) to speed up things

This commit is contained in:
Alexandre Aubin 2024-08-08 16:46:24 +02:00
parent a9e71e88df
commit 7f2da0af73
2 changed files with 9 additions and 10 deletions

View file

@ -42,7 +42,9 @@ workflow:
- when: always
variables:
YNH_BUILD_DIR: "/ynh-build"
GIT_CLONE_PATH: '$CI_BUILDS_DIR/$CI_COMMIT_SHA/$CI_JOB_ID'
YNH_SOURCE: "https://github.com/yunohost"
YNH_DEBIAN: "bookworm"
include:
- template: Code-Quality.gitlab-ci.yml

View file

@ -4,24 +4,21 @@
- job: actionsmap
- job: invalidcode311
image: "build-and-lint"
variables:
YNH_SOURCE: "https://github.com/yunohost"
YNH_DEBIAN: "bookworm"
before_script:
- echo $PWD
- echo $CI_PROJECT_DIR
- mkdir -p $YNH_BUILD_DIR
- DEBIAN_FRONTEND=noninteractive apt update
variables:
YNH_BUILD_DIR: "$GIT_CLONE_PATH/build"
artifacts:
paths:
- ./*.deb
.build_script: &build_script
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" install devscripts --no-install-recommends
- cd $YNH_BUILD_DIR/$PACKAGE
- git status || true
- git log -n 1 || true
- VERSION=$(dpkg-parsechangelog -S Version 2>/dev/null)
- VERSION_NIGHTLY="${VERSION}+$(date +%Y%m%d%H%M)"
- dch --package "${PACKAGE}" --force-bad-version -v "${VERSION_NIGHTLY}" -D "unstable" --force-distribution "Daily build."
- 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}