--- # # SPDX-License-Identifier: GPL-3.0-or-later default: image: "archlinux:latest" interruptible: true artifacts: expire_in: 2 weeks stages: - check - test - build - publish - pages variables: BUILD_PUBLISH_PACKAGES: base-devel git python-pdm SYSTEM_PACKAGES: git pyalpm python-aiofiles python-email-validator python-jinja python-magic python-orjson python-pydantic python-pydantic-settings python-pyxdg python-pyzstd python-subprocess-tee python-tomli python-pydantic-core SYSTEM_INSTALL_PACKAGES: make python-build python-installer python-pdm python-setuptools python-sphinx python-sphinx-argparse python-sphinx_rtd_theme python-sphinxcontrib-programoutput python-wheel SYSTEM_TEST_PACKAGES: make python-coverage python-pytest python-pytest-asyncio python-pytest-lazy-fixtures TEST_PACKAGES: base-devel cython git python-pdm libxslt rust .check: stage: check before_script: - export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 - | read -r -a deps <<< "${TEST_PACKAGES}" pacman --noconfirm -Syu --needed "${deps[@]}" linter: extends: .check script: - ln -sf /usr/bin/python3.12 /usr/bin/python3 - ln -sf /usr/bin/python3.12 /usr/bin/python - pdm install -vG default - pdm run lint .bump_dependencies_to_latest: &bump_dependencies_to_latest - | if [[ $TEST_LATEST = true ]]; then pdm update --unconstrained fi .test: stage: test before_script: - | read -r -a deps <<< "${TEST_PACKAGES}" pacman --noconfirm -Syu --needed "${deps[@]}" - *bump_dependencies_to_latest coverage: extends: .test script: - pdm install - pdm coverage coverage: '/TOTAL.*\s([.\d]+)%/' artifacts: reports: coverage_report: coverage_format: cobertura path: coverage.xml junit: junit-report.xml .integration_test: stage: test before_script: - printf "[multilib]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf - pacman --noconfirm -Fy - | read -r -a test_deps <<< "${TEST_PACKAGES}" pacman --noconfirm -Syu --needed "${test_deps[@]}" - *bump_dependencies_to_latest integration: extends: .integration_test script: - pdm install -G default - pdm run integration .system_test: stage: test before_script: - | read -r -a system_deps <<< "${SYSTEM_PACKAGES}" read -r -a test_deps <<< "${SYSTEM_TEST_PACKAGES}" pacman --noconfirm -Syu --needed "${system_deps[@]}" "${test_deps[@]}" system_coverage: extends: .system_test script: - make test .system_integration_test: stage: test before_script: - printf "[multilib]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf - pacman --noconfirm -Fy - | read -r -a install_deps <<< "${SYSTEM_INSTALL_PACKAGES}" read -r -a system_deps <<< "${SYSTEM_PACKAGES}" read -r -a test_deps <<< "${SYSTEM_TEST_PACKAGES}" pacman --noconfirm -Syu --needed "${install_deps[@]}" "${system_deps[@]}" "${test_deps[@]}" - make build - make system-docs - DESTDIR=/ make install system_integration: extends: .system_integration_test script: - make integration system_integration_core: extends: .system_integration_test cache: paths: - core/ script: - pacman --noconfirm -Syu --needed rsync - rsync --archive --copy-links --delete --human-readable --verbose --timeout=600 --contimeout=60 rsync://geo.mirror.pkgbuild.com/packages/core . - find "${PWD}/core/os/x86_64/" -type f -name '*.pkg.tar.*' -not -name '*.sig' | xargs --max-args 1 --verbose repod-file package inspect >/dev/null rules: - if: $CI_PIPELINE_SOURCE == "schedule" && $TEST_CORE .build: stage: build before_script: - | read -r -a deps <<< "${BUILD_PUBLISH_PACKAGES}" pacman --noconfirm -Syu --needed "${deps[@]}" build: extends: .build script: - pdm build docs: extends: .build script: - pdm install -G default - pdm docs after_script: - mv docs/_build/html public artifacts: paths: - public pages: stage: pages script: - "true" artifacts: paths: - public rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH regex: extends: .test script: - pdm install -G default - pdm regex pypi_publish: before_script: - | read -r -a deps <<< "${BUILD_PUBLISH_PACKAGES}" pacman --noconfirm -Syu --needed "${deps[@]}" rules: - if: '$PDM_PUBLISH_PASSWORD && $CI_COMMIT_TAG && $CI_PROJECT_PATH == "archlinux/repod"' script: - pdm publish stage: publish tags: - secure variables: PDM_PUBLISH_USERNAME: __token__