Skip to content

Nightly builds in Fedora Copr #1917

Nightly builds in Fedora Copr

Nightly builds in Fedora Copr #1917

Workflow file for this run

---
name: Nightly builds in Fedora Copr
on:
schedule:
- cron: '0 0 * * *' # at midnight UTC
# allow to run the workflow manually from GitHub web interface
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
container: ghcr.io/rpm-software-management/dnf-ci-host
strategy:
fail-fast: false # don't fail all matrix jobs if one of them fails
matrix:
project: [dnf-nightly, dnf-nightly-sanitizers]
component: [drpm, createrepo_c, libsolv, libmodulemd, libpkgmanifest, librepo, libcomps, libdnf, dnf, dnf-plugins-core, dnf-plugins-extras, microdnf, dnf5]
include:
# Default url
- url: https://github.com/rpm-software-management/
# Override url for specific components
- component: libmodulemd
url: https://github.com/fedora-modularity/
- component: libsolv
url: https://github.com/openSUSE/
steps:
- name: Check out sources
uses: actions/checkout@v4
- name: Setup Copr token
id: setup-ci
uses: ./.github/actions/setup-ci
with:
copr-user: ${{secrets.COPR_USER}}
copr-api-token: ${{secrets.COPR_API_TOKEN}}
# we don't want the workflow to continuously fail on forks
fail-without-copr: false
- name: Build in Copr
if: steps.setup-ci.outputs.copr-user
run: |
COMMAND_STRING="packit"
# Since we don't control libsolv upstream work around missing packit initialization and specfile.
if [[ "${{matrix.component}}" == "libsolv" ]]; then
cat > packit_libsolv.yaml << EOL
specfile_path: libsolv.spec
version_suffix: "^{PACKIT_PROJECT_SNAPSHOTID}"
update_release: false
actions:
post-upstream-clone:
# Download spec
- "wget https://src.fedoraproject.org/rpms/libsolv/raw/main/f/libsolv.spec -O libsolv.spec"
# Download patches used in the spec
- bash -c "spectool -P libsolv.spec | awk '{print \$2}' | xargs -I {} curl --retry 3 -O https://src.fedoraproject.org/rpms/libsolv/raw/rawhide/f/{}"
EOL
COMMAND_STRING+=" -c ./packit_libsolv.yaml"
fi
COMMAND_STRING+=" build in-copr --owner ${{steps.setup-ci.outputs.copr-user}} --project ${{matrix.project}} ${{matrix.url}}${{matrix.component}}"
# To test different build configurations when a PR is created
# dnf5 upstream defines multiple packages in .packit.yaml:
# `dnf5` and `dnf5-without-modules`.
# In nightly we want to build dnf5 only once (with modularity enabled).
if [[ "${{matrix.component}}" == "dnf5" ]]; then
COMMAND_STRING+=" --package dnf5"
fi
echo "Executing: $COMMAND_STRING"
$COMMAND_STRING