env: TESTS_TIMEOUT: 10 # in minutes on: workflow_call: inputs: image: required: true type: string image_options: required: true type: string jobs: goblint: name: Goblint runs-on: ubuntu-latest container: image: ghcr.io/bilelmoussaoui/goblint:main-9c34d77 permissions: # Required for uploading SARIF results security-events: write steps: - name: Check out xdg-desktop-portal uses: actions/checkout@v6 - name: Run goblint run: goblint --format sarif > goblint.sarif - name: Upload SARIF results uses: github/codeql-action/upload-sarif@v3 with: sarif_file: goblint.sarif category: goblint checks: name: Checks runs-on: ubuntu-latest container: image: ${{ inputs.image }} options: ${{ inputs.image_options }} steps: - name: Configure environment run: | # Mark workspace as safe, to prevent git from failing git config --global --add safe.directory $GITHUB_WORKSPACE # the image uses `pip install --user`, let's make sure we find it echo PYTHONPATH="/root/.local/lib/python$(python3 -c 'import sys; print("{}.{}".format(*sys.version_info))')/site-packages:$PYTHONPATH" | tee -a $GITHUB_ENV echo PATH="/root/.local/bin:$PATH" | tee -a $GITHUB_ENV - name: Check out xdg-desktop-portal uses: actions/checkout@v4 - name: Check POTFILES.in run: .github/workflows/check-potfiles.sh if: always() - name: Check Qt annotations run: find -name "*.xml" | xargs -n1 /usr/lib/qt6/bin/qdbusxml2cpp if: always() - name: Run pre-commit hooks run: pre-commit run --show-diff-on-failure --color=always --all-files if: always() 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: | # Mark workspace as safe, to prevent git from failing git config --global --add safe.directory $GITHUB_WORKSPACE - name: Check out xdg-desktop-portal uses: actions/checkout@v4 - name: Build xdg-desktop-portal run: | meson setup _build \ -Dinstalled-tests=true \ -Dtests=enabled \ -Db_sanitize=${{ matrix.sanitizer }} \ -Db_lundef=false \ -Dwerror=true - name: Run xdg-desktop-portal tests run: XDP_TEST_RUN_LONG=1 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: Create dist tarball run: | ls -la timeout --signal=KILL -v ${TESTS_TIMEOUT}m meson dist -C _build --include-subprojects - 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