init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled

This commit is contained in:
allhaileris
2026-02-16 15:50:16 +03:00
commit afb81b8278
13816 changed files with 3689732 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
# This Containerfile builds the image that we use in all github workflows.
# When this file is changed, or one needs to rebuild the image for another
# reason, bump the `IMAGE_TAG` in the container.yml workflow.
FROM ubuntu:latest
RUN apt update
RUN apt upgrade -y
# Install dependencies
RUN apt install -y --no-install-recommends \
gcc clang \
ca-certificates \
desktop-file-utils \
fuse3 \
gettext \
git \
gnome-desktop-testing \
gtk-doc-tools \
jq \
libcap2-bin \
libflatpak-dev \
libfontconfig1-dev \
libfuse3-dev \
libgdk-pixbuf-2.0-dev \
librsvg2-2 \
librsvg2-common \
libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-good \
libgstreamer-plugins-good1.0-dev \
gstreamer1.0-tools \
libgeoclue-2-dev \
libglib2.0-dev \
libgudev-1.0-dev \
libjson-glib-dev \
libpipewire-0.3-dev \
libsystemd-dev \
libtool \
llvm \
libclang-rt-18-dev \
python3-gi \
shared-mime-info
# Install meson
RUN apt install -y --no-install-recommends meson
# Install pytest
RUN apt install -y --no-install-recommends \
python3-pytest \
python3-pytest-xdist \
python3-dbusmock \
python3-dbus \
libumockdev0 \
libumockdev-dev \
umockdev \
gir1.2-umockdev-1.0
# Install pip
RUN apt install -y --no-install-recommends python3-pip
# Install doc dependencies
RUN pip install --user --break-system-packages furo">=2024.04.27" \
sphinx-copybutton sphinxext-opengraph matplotlib
# Install pre-commit
RUN pip install --user --break-system-packages pre-commit
# Install qdbusxml2cpp
RUN apt install -y --no-install-recommends qt6-base-dev-tools

View File

@@ -0,0 +1,88 @@
env:
TESTS_TIMEOUT: 10 # in minutes
on:
workflow_call:
inputs:
image:
required: true
type: string
image_options:
required: true
type: string
jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
compiler: ['gcc', 'clang']
sanitizer: ['address']
container:
image: ${{ inputs.image }}
env:
CFLAGS: -Wp,-D_FORTIFY_SOURCE=2
CC: ${{ matrix.compiler }}
XDP_TEST_IN_CI: 1
G_MESSAGES_DEBUG: all
options: ${{ inputs.image_options }}
steps:
- name: Configure environment
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
echo XDG_DATA_DIRS=$GITHUB_WORKSPACE/tests/share:/usr/local/share:/usr/share | tee -a $GITHUB_ENV
- name: Check out xdg-desktop-portal
uses: actions/checkout@v4
- name: Run pre-commit hooks
run: |
export PYTHONPATH="/root/.local/lib/python$(python3 -c 'import sys; print("{}.{}".format(*sys.version_info))')/site-packages:$PYTHONPATH"
export PATH="/root/.local/bin:$PATH"
pre-commit run --show-diff-on-failure --color=always --all-files
- name: Check POTFILES.in
run: .github/workflows/check-potfiles.sh
- name: Build xdg-desktop-portal
run: |
meson setup _build \
-Dinstalled-tests=true \
-Dtests=enabled \
-Db_sanitize=${{ matrix.sanitizer }} \
-Db_lundef=false
meson compile -C _build
- name: Run xdg-desktop-portal tests
run: timeout --signal=KILL -v ${TESTS_TIMEOUT}m meson test -C _build
- name: Install xdg-desktop-portal
run: meson install -C _build
- name: Run xdg-desktop-portal installed-tests
run: |
test -n "$(gnome-desktop-testing-runner -l xdg-desktop-portal)"
gnome-desktop-testing-runner --report-directory installed-test-logs/ \
-t $((TESTS_TIMEOUT * 60)) xdg-desktop-portal
- name: Check Qt annotations
run: find -name "*.xml" | xargs -n1 /usr/lib/qt6/bin/qdbusxml2cpp
- name: Create dist tarball
run: |
ls -la
timeout --signal=KILL -v ${TESTS_TIMEOUT}m meson dist -C _build
- name: Upload test logs
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test logs (${{ matrix.compiler }}, ${{ matrix.sanitizer }})
path: |
tests/*.log
test-*.log
installed-test-logs/
_build/meson-logs/testlog.txt

View File

@@ -0,0 +1,92 @@
#!/usr/bin/env bash
# FIXME stolen from gnome-control-center, GPLv2
# This project is LGPLv2
# https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2269#note_2079291
srcdirs="src document-portal"
uidirs=$srcdirs
desktopdirs=$srcdirs
policydirs=$srcdirs
xmldirs=$srcdirs
# find source files that contain gettext functions with literal or GETTEXT_PACKAGE argument
files=$(grep -lRs --include='*.c' 'gettext *(\("\|GETTEXT_PACKAGE,\)' $srcdirs)
# find source files that contain gettext macros
files="$files "$(grep -lRs --include='*.c' --include='*.h' '[^I_)]_(' $srcdirs)
# find ui files that contain translatable string
files="$files "$(grep -lRis --include='*.ui' 'translatable="[ty1]' $uidirs)
# find .desktop files
files="$files "$(find $desktopdirs -name '*.desktop*')
# find .policy files
files="$files "$(find $policydirs -name '*.policy*')
# find .xml.in and .gschema.xml files
files="$files "$(find $xmldirs -not -name '*.gresource.xml*' \
-name '*.xml.in*' -o \
-name '*.gschema.xml')
# filter out excluded files
if [ -f po/POTFILES.skip ]; then
files=$(for f in $files; do
! grep -q "^$f" po/POTFILES.skip && echo "$f"
done)
fi
# find those that aren't listed in POTFILES.in
missing=$(for f in $files; do
! grep -q "^$f" po/POTFILES.in && echo "$f"
done)
# find those that are listed in POTFILES.in but do not contain translatable strings
invalid=$(while IFS= read -r f; do
! grep -q "$f" <<< "$files" && echo "$f"
done < <(grep '^[^#]' po/POTFILES.in))
# find out if POTFILES.in is sorted correctly, ignoring empty lines
sorted=$(grep '^[^#]' po/POTFILES.in | \
LC_ALL=en_US.UTF-8 sort -cu 2>&1 >/dev/null | \
awk -F ': *' '{print $5}')
if [ ${#missing} -eq 0 ] && [ ${#invalid} -eq 0 ] && [ ${#sorted} -eq 0 ]; then
exit 0
fi
if [ ${#missing} -ne 0 ]; then
cat >&2 << EOT
The following files are missing from po/POTFILES.in or po/POTFILES.skip:
EOT
for f in $missing; do
echo " $f" >&2
done
fi
if [ ${#invalid} -ne 0 ]; then
cat >&2 << EOT
The following files are in po/POTFILES.in but are missing or not translatable:
EOT
for f in $invalid; do
echo " $f" >&2
done
fi
if [ ${#sorted} -ne 0 ]; then
cat >&2 << EOT
The following file is not sorted properly in po/POTFILES.in:
EOT
echo " $sorted" >&2
fi
echo >&2
exit 1

View File

@@ -0,0 +1,59 @@
env:
IMAGE_TAG: 20250213-1
on:
workflow_call:
outputs:
image:
description: "The build image"
value: ${{ jobs.build-container.outputs.image }}
image_options:
description: "The options to use with the image"
value: --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined --privileged
jobs:
build-container:
name: Create build container
runs-on: ubuntu-latest
outputs:
image: ${{ steps.check.outputs.image }}
steps:
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Check if image already exists on GHCR
id: check
run: |
ACTOR="${{ github.actor }}"
OWNER="${{ github.repository_owner }}"
image_actor="ghcr.io/${ACTOR,,}/xdg-desktop-portal:${{ env.IMAGE_TAG }}"
image_owner="ghcr.io/${OWNER,,}/xdg-desktop-portal:${{ env.IMAGE_TAG }}"
if docker manifest inspect "${image_owner}" >/dev/null ; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "image=${image_owner}" >> "$GITHUB_OUTPUT"
exit 0
fi
if docker manifest inspect "${image_actor}" >/dev/null ; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "image=${image_actor}" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "exists=false" >> "$GITHUB_OUTPUT"
echo "image=${image_owner}" >> "$GITHUB_OUTPUT"
- name: Build and push
if: ${{ steps.check.outputs.exists == 'false' }}
uses: docker/build-push-action@v5
with:
push: true
file: .github/workflows/Containerfile
tags: ${{ steps.check.outputs.image }}

View File

@@ -0,0 +1,30 @@
name: CI
on: [push, pull_request]
jobs:
build-container:
name: Container
uses: ./.github/workflows/container.yml
permissions:
packages: write
build-and-test:
name: Build and Test
uses: ./.github/workflows/build-and-test.yml
needs: build-container
with:
image: ${{ needs.build-container.outputs.image }}
image_options: ${{ needs.build-container.outputs.image_options }}
pages:
name: Documentation & Website
uses: ./.github/workflows/pages.yml
needs: build-container
permissions:
contents: read
pages: write
id-token: write
with:
image: ${{ needs.build-container.outputs.image }}
image_options: ${{ needs.build-container.outputs.image_options }}

View File

@@ -0,0 +1,64 @@
on:
workflow_call:
inputs:
image:
required: true
type: string
image_options:
required: true
type: string
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
name: Build docs and website
runs-on: ubuntu-latest
container:
image: ${{ inputs.image }}
options: ${{ inputs.image_options }}
steps:
- name: Check out xdg-desktop-portal
uses: actions/checkout@v4
- name: Build docs
run: |
export PYTHONPATH="/root/.local/lib/python$(python3 -c 'import sys; print("{}.{}".format(*sys.version_info))')/site-packages:$PYTHONPATH"
export PATH="/root/.local/bin:$PATH"
meson setup _build \
-Ddocumentation=enabled \
-Dwerror=true
ninja -C _build doc/html
- name: Build website
uses: actions/jekyll-build-pages@v1
with:
source: ./doc/website
destination: ./_site
- name: Prepare docs
working-directory: _build/doc
run: |
mv ./html ../../_site/docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
# Deployment job
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@@ -0,0 +1,74 @@
name: Release new version
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build-container:
name: Container
uses: ./.github/workflows/container.yml
permissions:
packages: write
release:
name: Build and publish a release
runs-on: ubuntu-latest
needs: build-container
permissions:
contents: write
container:
image: ${{ needs.build-container.outputs.image }}
options: ${{ needs.build-container.outputs.image_options }}
env:
XDP_TEST_IN_CI: 1
steps:
- name: Configure environment
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Checkout the repository
uses: actions/checkout@v4
- name: Build xdg-desktop-portal
run: |
meson setup . _build
meson dist -C _build
- name: Extract release information
run: |
# Extract the release version
releaseVersion=`meson introspect --projectinfo _build/ | jq -r .version`
echo "releaseVersion=$releaseVersion" | tee -a $GITHUB_ENV
echo $releaseVersion
# Extract the changelog
{
echo "releaseChangelog<<EOF"
perl -0777nE 'print $& if /(?<=\n\n).*?(?=\nChanges in)/sg' NEWS.md
echo "\nEOF"
} | tee -a $GITHUB_ENV
echo $releaseChangelog
# Check if version is a pre-release
preRelease=$((`echo $releaseVersion | cut -d '.' -f2` % 2))
{
echo -n "preRelease="
if [ $preRelease = 1 ] || [ $preRelease = "true" ]; then
echo "true";
else
echo "false";
fi
} | tee -a $GITHUB_ENV
echo $preRelease
- name: Create release
uses: ncipollo/release-action@v1.15.0
with:
tag: ${{ env.releaseVersion }}
body: ${{ env.releaseChangelog }}
prerelease: ${{ env.preRelease }}
artifacts: _build/meson-dist/*