stages: - checksingle - build - test - qa - checkall #workflow: # rules: # - if: $CI_PIPELINE_SOURCE == "merge_request_event" || ($CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH=="master") || $TEST_ALL == "1" || $PROBABILITY variables: REPO_NAME: "apn" default: image: apnpucky/gentoo-apn:latest .configgeneral: image: $IMAGE interruptible: true tags: - $ARCH before_script: - mkdir -p ${PREFIX}/var/db/repos/apn && printf "[apn]\nlocation = ${PREFIX}/var/db/repos/apn\nsync-type = git\nsync-uri = https://gitlab.com/APN-Pucky/gentoo-apn.git" > ${PREFIX}/etc/portage/repos.conf/apn.conf && emaint -r apn sync - emerge --sync || emaint -r ${REPO_NAME} sync - emerge app-eselect/eselect-repository - eselect repository enable guru && emaint -r guru sync - eselect repository enable jjakob && emaint -r jjakob sync - echo '*/*::guru ~*' > ${PREFIX}/etc/portage/package.accept_keywords/guru - echo '*/*::jjakob ~*' > ${PREFIX}/etc/portage/package.accept_keywords/jjakob - pushd ${PREFIX}/var/db/repos/${REPO_NAME} && git remote set-branches origin '*' && git fetch -v --depth=1 && git pull --unshallow && git checkout ${CI_COMMIT_SHA} && popd - ACCEPT_KEYWORDS="* ~*" emerge -q '>=app-portage/pkg-testing-tools-0.2.1' - ACCEPT_KEYWORDS="**" emerge -q '=app-portage/pkg-testing-tools-9999' - echo 'dev-util/hermes ~*' >> ${PREFIX}/etc/portage/package.accept_keywords/zz-autoaccept - echo 'dev-python/uncertainties ~*' >> ${PREFIX}/etc/portage/package.accept_keywords/zz-autoaccept - echo 'dev-python/toposort ~*' >> ${PREFIX}/etc/portage/package.accept_keywords/zz-autoaccept - echo 'sci-physics/root ~*' >> ${PREFIX}/etc/portage/package.accept_keywords/zz-autoaccept - echo "*/*::${REPO_NAME} ~*" > ${PREFIX}/etc/portage/package.accept_keywords/${REPO_NAME} - echo '>=media-libs/libafterimage-1.20-r6 png gif tiff jpeg' >> ${PREFIX}/etc/portage/package.use/root - echo "=$CATEGORY/$PKG-$VERSION*::${REPO_NAME} **" >> ${PREFIX}/etc/portage/package.accept_keywords/${REPO_NAME} - mkdir -p ${PREFIX}/etc/portage/profile/ && echo "-python_targets_python3_12" >> ${PREFIX}/etc/portage/profile/use.mask .configall: extends: .configgeneral rules: - changes: - "$CATEGORY/$PKG/$PKG-$VERSION*.ebuild" - "$CATEGORY/$PKG/metadata.xml" - "$CATEGORY/$PKG/Manifest" - "$CATEGORY/$PKG/files/*" - "$CATEGORY/$PKG/.build" - ".build" .config: extends: .configgeneral rules: - changes: - "$CATEGORY/$PKG/$PKG-$VERSION*.ebuild" - "$CATEGORY/$PKG/metadata.xml" - "$CATEGORY/$PKG/Manifest" - "$CATEGORY/$PKG/files/*" - "$CATEGORY/$PKG/.build" - ".build" #local-pkgcheck: # image: apnpucky/gentoo-ebuild-ci # stage: checkall # tags: # - amd64 # before_script: # - emerge app-eselect/eselect-repository # - eselect repository enable science && emaint -r science sync # script: # - pkgcheck scan --exit --quiet # allow_failure: true # #global-pkgcheck: # image: apnpucky/gentoo-ebuild-ci # stage: checkall # tags: # - amd64 # before_script: # - emerge app-eselect/eselect-repository # - eselect repository enable science && emaint -r science sync # - echo '*/*::science ~*' > /etc/portage/package.accept_keywords/science # - echo "[${REPO_NAME}]">> /etc/portage/repos.conf/${REPO_NAME}.conf # - echo "location = /var/db/repos/${REPO_NAME}" >> /etc/portage/repos.conf/${REPO_NAME}.conf # - echo "sync-type = git" >> /etc/portage/repos.conf/${REPO_NAME}.conf # - echo "sync-uri = https://gitlab.com/APN-Pucky/gentoo-${REPO_NAME}.git" >> /etc/portage/repos.conf/${REPO_NAME}.conf # - emaint -r ${REPO_NAME} sync # - pushd /var/db/repos/${REPO_NAME} && git remote set-branches origin '*' && git fetch -v --depth=1 && git pull --unshallow && git checkout ${CI_COMMIT_SHA} && popd # script: # - pkgcheck ci -r ${REPO_NAME} --exit --quiet # allow_failure: true .check: image: apnpucky/gentoo-apn extends: .config stage: checksingle before_script: - emerge app-eselect/eselect-repository - eselect repository enable science && emaint -r science sync script: - pkgcheck scan "=$CATEGORY/$PKG-$VERSION*::${REPO_NAME}" --exit rules: - if: $ARCH == "amd64" .warn: image: apnpucky/gentoo-apn extends: .config stage: checksingle before_script: - emerge app-eselect/eselect-repository - eselect repository enable science && emaint -r science sync script: - pkgcheck scan "=$CATEGORY/$PKG-$VERSION*::${REPO_NAME}" --exit warning || exit 137 allow_failure: exit_codes: 137 rules: - if: $ARCH == "amd64" .build: stage: build extends: .configall script: - USE="-root" emerge "=$CATEGORY/$PKG-$VERSION*::${REPO_NAME}" --autounmask=y --autounmask-write --autounmask-continue --autounmask-use=y 2>&1 | tee "build_${CATEGORY}_${PKG}-${VERSION}_${ARCH}.log"; artifacts: when: always paths: - "build_*.log" expire_in: 1 week .test: stage: test extends: .configall script: - printf '\nPYTHON_SINGLE_TARGET=""\nLUA_SINGLE_TARGET=""' >> ${PREFIX}/etc/portage/make.conf - if [[ -n $PROBABILITY ]] && [[ $(( RANDOM % 101 )) -gt $PROBABILITY ]] ; then exit 137 ; fi - pkg-testing-tool -C --prefix="${PREFIX}" --append-emerge "--autounmask=y --autounmask-write --autounmask-continue --autounmask-use=y" --max-use-combinations 32 --ccache --extra-env-file 'test.conf' --append-required-use "!root" --test-feature-scope always -p "=$CATEGORY/$PKG-$VERSION*::${REPO_NAME}" --report test_${CATEGORY}_${PKG}-${VERSION}_${ARCH}.json 2>&1 | tee "test_${CATEGORY}_${PKG}-${VERSION}_${ARCH}.log"; artifacts: when: always paths: - "test_*.log" - "test*.json" expire_in: 1 week allow_failure: exit_codes: 137 .qa: stage: qa extends: .config script: - ls *.log - (! grep -A10 -B10 "QA Notice" test_${CATEGORY}_${PKG}-${VERSION}*.log) allow_failure: true check: extends: .check warn: extends: .warn build: needs: [] extends: .build test: needs: [] extends: .test qa: extends: .qa