Skip to content

refactor(linux)!: switch the Linux app to driver contract v2 #231

refactor(linux)!: switch the Linux app to driver contract v2

refactor(linux)!: switch the Linux app to driver contract v2 #231

Workflow file for this run

name: Build Linux
on:
push:
branches: [main, linux, "linux/**", "feat/linux-**"]
paths:
- "linux/**"
- ".github/workflows/build-linux.yml"
pull_request:
paths:
- "linux/**"
- ".github/workflows/build-linux.yml"
schedule:
- cron: "13 14 * * 1"
workflow_dispatch:
jobs:
fast:
name: Fast checks
runs-on: ubuntu-24.04
# The host runner ships glib 2.80, but libadwaita 1.6 (workspace pin)
# transitively requires gio-2.0 >= 2.82. ubuntu:26.04 gives us GLib
# 2.88 plus the meson, appstream and desktop-file-utils packages the
# data suite validates with. The integration job stays on the host
# runner: driver crates depend only on tablepro-core, so they don't
# pull in libadwaita.
container:
image: ubuntu:26.04
env:
DEBIAN_FRONTEND: noninteractive
defaults:
run:
working-directory: linux
steps:
# Before the checkout, not after: actions/checkout falls back to
# downloading a tarball when git is missing, which leaves no .git
# for `meson dist` to read. The workspace is owned by the host's
# runner user and every step here runs as root, so git also needs
# to be told the checkout is not a stranger's.
- name: Install git
run: |
apt-get update
apt-get install -y --no-install-recommends ca-certificates git
git config --global --add safe.directory "$GITHUB_WORKSPACE"
working-directory: /
- uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'schedule' && 'linux' || github.ref }}
- name: Install system dependencies
# ubuntu:26.04 is minimal: curl + ca-certificates for
# rust-toolchain's rustup install, then the meson toolchain, the
# -dev packages the workspace links, and the runtime pieces the
# test suites need (xvfb, dbus, gnome-keyring for the Secret
# Service step, openssh-client for the SSH transport). git is
# already in from the step above.
# No sudo (container runs as root by default).
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
pkgconf \
meson \
ninja-build \
gettext \
desktop-file-utils \
appstream \
libglib2.0-bin \
libxml2-utils \
libgtk-4-dev \
libadwaita-1-dev \
libgtksourceview-5-dev \
libsecret-1-dev \
libsqlite3-dev \
libkrb5-dev \
clang \
libclang-dev \
adwaita-icon-theme \
locales \
gnome-keyring \
openssh-client \
xvfb \
xauth \
dbus-daemon
- uses: dtolnay/rust-toolchain@ce678459e9fc7500d337468f904b95f1b5c10b5e # 1.98
with:
toolchain: "1.98"
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: linux
- name: Generate the en_US.UTF-8 locale
# glibc loads no catalogue under C or C.UTF-8, so the i18n
# catalogue test needs a real locale on the machine.
run: localedef -i en_US -f UTF-8 en_US.UTF-8
- name: Configure
run: meson setup _build -Dprofile=development
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy
run: meson devenv -C _build cargo clippy --locked --workspace --all-targets -- -D warnings
- name: Clippy without default features
run: meson devenv -C _build cargo clippy --locked --workspace --all-targets --no-default-features -- -D warnings
- name: Build
run: meson compile -C _build
- name: Tests
run: xvfb-run -a dbus-run-session -- meson test -C _build --print-errorlogs
- name: Secret Service tests
run: |
dbus-run-session -- bash -c "gnome-keyring-daemon --components=secrets --daemonize --unlock <<< ci \
&& meson devenv -C _build cargo test --locked -p tablepro-storage --test secret_service -- --ignored"
- name: Dist
run: meson dist -C _build --no-tests --formats xztar
i18n:
name: Translations
runs-on: ubuntu-24.04
# fedora:44 ships gettext 0.24, the first release whose xgettext reads
# Rust. An older one falls back to its C lexer and misreads lifetimes.
container:
image: fedora:44
defaults:
run:
working-directory: linux
steps:
# Same reason as the fast job: without git, actions/checkout
# downloads a tarball and every `git` below has no repository to
# read.
- name: Install git
run: |
dnf install -y --setopt=install_weak_deps=False git
git config --global --add safe.directory "$GITHUB_WORKSPACE"
working-directory: /
- uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'schedule' && 'linux' || github.ref }}
- name: Install system dependencies
run: |
dnf install -y --setopt=install_weak_deps=False \
gcc pkgconf meson ninja-build gettext \
desktop-file-utils appstream glib2-devel \
gtk4-devel libadwaita-devel gtksourceview5-devel \
sqlite-devel krb5-devel clang-devel cargo rust
- name: POTFILES.in is current
run: |
git ls-files 'crates/app/src/*.rs' 'data/resources/*.ui' 'data/*.desktop.in.in' \
'data/*.gschema.xml' 'data/*.metainfo.xml.in.in' > po/POTFILES.in
git diff --exit-code po/POTFILES.in
- name: Configure
run: meson setup _build --fatal-meson-warnings
- name: The POT template still extracts
run: meson compile -C _build tablepro-pot
- name: Discard the generated template
run: git checkout po/tablepro.pot
integration:
name: Docker tests (${{ matrix.package }})
runs-on: ubuntu-24.04
needs: fast
strategy:
fail-fast: false
matrix:
package:
- tablepro-driver-postgres
- tablepro-driver-mysql
- tablepro-driver-mssql
- tablepro-driver-clickhouse
- tablepro-ssh
- tablepro-test-fixtures
include:
- package: tablepro-ssh
apt: openssh-client
- package: tablepro-test-fixtures
apt: openssh-client
defaults:
run:
working-directory: linux
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'schedule' && 'linux' || github.ref }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config ${{ matrix.apt }}
- uses: dtolnay/rust-toolchain@ce678459e9fc7500d337468f904b95f1b5c10b5e # 1.98
with:
toolchain: "1.98"
- uses: Swatinem/rust-cache@v2
with:
workspaces: linux
key: ${{ matrix.package }}
- uses: taiki-e/install-action@3f74d7c16a4242f1c95561e98edc25d36adb4375 # v2.87.12
with:
tool: cargo-nextest@0.9.144
- name: Verify docker is available
run: docker version
- name: Docker tests
run: cargo nextest run --locked --profile ci -p ${{ matrix.package }} --run-ignored only
- name: Upload JUnit report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-${{ matrix.package }}
path: linux/target/nextest/ci/junit.xml
integration-session:
# The session crate builds tablepro-storage, which links GIO 2.88,
# and the host runner ships 2.80, so this entry runs in the fast
# job's image instead of the matrix above. The host's Docker socket
# is mounted; testcontainers sees /.dockerenv and reaches the
# containers it starts through the bridge gateway.
name: Docker tests (tablepro-session)
runs-on: ubuntu-24.04
needs: fast
container:
image: ubuntu:26.04
env:
DEBIAN_FRONTEND: noninteractive
options: -v /var/run/docker.sock:/var/run/docker.sock
defaults:
run:
working-directory: linux
steps:
- name: Install git
run: |
apt-get update
apt-get install -y --no-install-recommends ca-certificates git
git config --global --add safe.directory "$GITHUB_WORKSPACE"
working-directory: /
- uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'schedule' && 'linux' || github.ref }}
- name: Install system dependencies
# The glib, sqlite and clang development packages the fast job
# builds storage with, plus openssh-client for the tunnel tests.
run: |
apt-get install -y --no-install-recommends \
build-essential \
curl \
pkgconf \
libglib2.0-dev \
libsqlite3-dev \
clang \
libclang-dev \
openssh-client
- uses: dtolnay/rust-toolchain@ce678459e9fc7500d337468f904b95f1b5c10b5e # 1.98
with:
toolchain: "1.98"
- uses: Swatinem/rust-cache@v2
with:
workspaces: linux
key: tablepro-session
- uses: taiki-e/install-action@3f74d7c16a4242f1c95561e98edc25d36adb4375 # v2.87.12
with:
tool: cargo-nextest@0.9.144
- name: Verify docker is available
# No Docker CLI in the image; the API answers on the socket.
run: curl --fail --silent --show-error --unix-socket /var/run/docker.sock http://localhost/_ping
- name: Docker tests
run: cargo nextest run --locked --profile ci -p tablepro-session --run-ignored only
- name: Upload JUnit report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-tablepro-session
path: linux/target/nextest/ci/junit.xml