From c385cd4eb7a93fd22b497fa0adac6a8316816f3c Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Fri, 25 Oct 2024 14:48:27 +0200 Subject: [PATCH] ci: update github workflows to use meson Running `meson dist` requires working git but that doesn't seem to be the default in github actions when running jobs inside container. Any git invocation fails with the following error: fatal: detected dubious ownership in repository at '/__w/virt-manager/virt-manager' To add an exception for this directory, call: git config --global --add safe.directory /__w/virt-manager/virt-manager So that's what this patch does to make `meson dist` work correctly. Signed-off-by: Pavel Hrdina --- .github/workflows/ci.yml | 19 ++++++++++++++---- .../workflows/test-against-libvirt-git.yml | 20 +++++++++++++++---- .github/workflows/translations.yml | 16 ++++++++++++--- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f1fb551d..13e57e727 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,14 +25,25 @@ jobs: - name: Install RPM build deps run: | - dnf builddep -y ./virt-manager.spec + dnf install -y \ + gettext \ + python3-devel \ + python3-docutils \ + meson - name: Build RPM and test install run: | - ./setup.py rpm + git config --global --add safe.directory $PWD + + meson setup build \ + -Dupdate-icon-cache=false \ + -Dcompile-schemas=false \ + -Dtests=disabled + meson dist -C build + rpmbuild -tb build/meson-dist/virt-manager*.tar.xz dnf install -y \ - noarch/virt-install*.rpm \ - noarch/virt-manager-common*.rpm + ~/rpmbuild/RPMS/noarch/virt-install*.rpm \ + ~/rpmbuild/RPMS/noarch/virt-manager-common*.rpm - name: Run test suite and generate coverage report run: | diff --git a/.github/workflows/test-against-libvirt-git.yml b/.github/workflows/test-against-libvirt-git.yml index 9822cc9a2..c1c1670d5 100644 --- a/.github/workflows/test-against-libvirt-git.yml +++ b/.github/workflows/test-against-libvirt-git.yml @@ -27,7 +27,13 @@ jobs: python3-pytest \ python3-pytest-error-for-skips - dnf builddep -y ./virt-manager.spec libvirt + dnf install -y \ + gettext \ + python3-devel \ + python3-docutils \ + meson + + dnf builddep -y libvirt - name: checkout and build libvirt run: | @@ -39,10 +45,16 @@ jobs: - name: Build RPM and test install run: | - ./setup.py rpm + git config --global --add safe.directory $PWD + meson setup build \ + -Dupdate-icon-cache=false \ + -Dcompile-schemas=false \ + -Dtests=disabled + meson dist -C build + rpmbuild -tb build/meson-dist/virt-manager*.tar.xz dnf install -y \ - noarch/virt-install*.rpm \ - noarch/virt-manager-common*.rpm + ~/rpmbuild/RPMS/noarch/virt-install*.rpm \ + ~/rpmbuild/RPMS/noarch/virt-manager-common*.rpm - name: Run test suite run: | diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 0e82a4d3c..41449c11b 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -8,7 +8,7 @@ on: jobs: - # This job will run ./setup.py extract_messages on top of git main + # This job will run meson compile -C build virt-manager-pot on top of git main # and force push that to the 'translations' branch. That branch will # always have an up to date .pot file for use in weblate update-translation-pot: @@ -22,7 +22,13 @@ jobs: steps: - name: Install deps run: | - dnf install -y python3-setuptools gettext git diffutils + dnf install -y \ + git \ + diffutils \ + gettext \ + python3-devel \ + python3-docutils \ + meson - uses: actions/checkout@v4 with: @@ -39,7 +45,11 @@ jobs: git rebase remotes/origin/translations cp po/virt-manager.pot old.pot - ./setup.py extract_messages + meson setup build \ + -Dupdate-icon-cache=false \ + -Dcompile-schemas=false \ + -Dtests=disabled + meson compile -C build virt-manager-pot ec=0 diff -q -I 'POT-Creation-Date' old.pot po/virt-manager.pot || ec=$? case "${ec}" in