Repository navigation
799 lines (785 loc) · 33.8 KB
/
Copy pathbuild-linux.yml
File metadata and controls
799 lines (785 loc) · 33.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
name: Build Linux
# CI calls it with the baseline, nightly.yml with extended. A manual run takes the extended jobs too.
on:
workflow_call:
inputs:
docs-only:
description: Run only the docs links job.
type: boolean
required: true
dependencies:
description: Also check the minimum Rust version, the Arm64 Flatpak and the advisory database.
type: boolean
default: false
extended:
description: Also run every other server release, the minimum Rust version, the Arm64 Flatpak, paths with spaces and the advisory database.
type: boolean
default: false
workflow_dispatch:
inputs:
extended:
description: Also run every other server release, the minimum Rust version, the Arm64 Flatpak, paths with spaces and the advisory database.
type: boolean
default: true
permissions:
contents: read
env:
# Line tables still give a backtrace its files and lines. Full debug info made each Rust cache about 45% larger,
# and with core.yml's and windows.yml's they share the repository's 10 GB, which evicted those.
CARGO_PROFILE_DEV_DEBUG: line-tables-only
CARGO_ABOUT_VERSION: 0.9.2
CARGO_DENY_VERSION: 0.20.2
# The Flatpak Devel manifest pins the same release.
CARGO_NEXTEST_VERSION: 0.9.144
CARGO_SHEAR_VERSION: 1.13.4
LYCHEE_VERSION: 0.24.2
LYCHEE_SHA256: 1f4e0ef7f6554a6ed33dd7ac144fb2e1bbed98598e7af973042fc5cd43951c9a
jobs:
docs:
name: Documentation links
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install lychee
run: |
curl --fail --silent --show-error --location --output "$RUNNER_TEMP/lychee.tar.gz" \
"https://github.com/lycheeverse/lychee/releases/download/lychee-v$LYCHEE_VERSION/lychee-x86_64-unknown-linux-gnu.tar.gz"
echo "$LYCHEE_SHA256 $RUNNER_TEMP/lychee.tar.gz" | sha256sum --check --strict
mkdir "$RUNNER_TEMP/lychee"
tar -xzf "$RUNNER_TEMP/lychee.tar.gz" -C "$RUNNER_TEMP/lychee" --strip-components=1 \
lychee-x86_64-unknown-linux-gnu/lychee
echo "$RUNNER_TEMP/lychee" >> "$GITHUB_PATH"
- name: Links and anchors in the Linux and core docs resolve
# Offline, so only links to files and headings in the tree are
# checked: the ones a rename or a move breaks.
run: lychee --offline --include-fragments --no-progress 'linux/**/*.md' 'core/**/*.md'
fast:
name: Fast checks
if: ${{ !inputs.docs-only }}
runs-on: ubuntu-24.04
timeout-minutes: 150
# The host runner ships GLib 2.80, below the GNOME 50 floor.
# ubuntu:26.04 gives GLib 2.88 plus the meson, appstream and
# desktop-file-utils packages the data suite validates with.
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 make-dist.sh to archive. 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install system dependencies
# ubuntu:26.04 is minimal: curl for rust-toolchain's rustup
# install, then the meson toolchain, the -dev packages the
# workspace links, the runtime pieces the test suites need (xvfb,
# dbus, gnome-keyring for the Secret Service step, openssh-client
# for the SSH transport, glycin-loaders for a value's picture),
# and xz for the source tarball.
run: |
apt-get install -y --no-install-recommends \
build-essential \
curl \
pkgconf \
meson \
ninja-build \
gettext \
desktop-file-utils \
appstream \
libglib2.0-bin \
libxml2-utils \
libgtk-4-dev \
libadwaita-1-dev \
libgtksourceview-5-dev \
libsqlite3-dev \
libkrb5-dev \
liblcms2-dev \
libseccomp-dev \
clang \
libclang-dev \
adwaita-icon-theme \
glycin-loaders \
locales \
gnome-keyring \
openssh-client \
xvfb \
xauth \
dbus-daemon \
xz-utils
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: "1.98"
components: rustfmt, clippy
# Meson points Cargo at _build/cargo-home and _build/cargo-target,
# so those are what the cache keeps. The workspace is the top of the
# repository.
# Saved from main only: a pull request's cache serves that pull request alone and pushes main's out.
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: . -> linux/_build/cargo-target
cache-directories: linux/_build/cargo-home
save-if: ${{ github.ref == 'refs/heads/main' }}
# rust-cache restores DuckDB's unpacked sources as empty folders, which its build script cannot unpack over.
- name: Drop the emptied DuckDB sources
run: rm -rf _build/cargo-target/duckdb-sources
- 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: No thread-local state in app services
# Trackers belong to a workspace; a thread_local! registry shares
# one window's unsaved edits with every other window.
run: |
if grep -rn 'thread_local!' crates/app/src/services; then
echo "::error::crates/app/src/services must not hold thread_local! state"
exit 1
fi
- name: No blocking file I/O in the UI code
# This code runs on the GTK thread, where a slow disk or a
# network mount freezes the window. A storage call ending in
# _blocking is handed to spawn_blocking_task on the same line,
# which is what this check can see. A Path method that stats the
# disk blocks the same way. Tests may do either.
run: |
# The $0 in the awk program is awk's record, not a shell variable.
# shellcheck disable=SC2016
found=$(find crates/app/src/ui -name '*.rs' ! -name tests.rs ! -path '*/tests/*' -print0 \
| xargs -0 awk '/^mod tests \{/ { nextfile } /std::fs::/ || /\.(exists|try_exists|is_dir|is_file|is_symlink|canonicalize|read_dir|read_link|symlink_metadata)\(/ || (/_blocking\(/ && !/spawn_blocking_task\(/) { print FILENAME ":" FNR ": " $0 }')
if [ -n "$found" ]; then
echo "$found"
echo "::error::crates/app/src/ui must not call std::fs or a Path method that reads the disk, or a _blocking function outside spawn_blocking_task"
exit 1
fi
- name: Window actions on the window's own map
# GTK exports a window's own action map as win. A group inserted
# under that name hides it from the application's accelerators
# and from D-Bus.
run: |
if grep -rn 'insert_action_group("win"' crates/app/src; then
echo "::error::add window actions with add_action_entries on the window, not a group inserted as win"
exit 1
fi
- name: Tab ids in the tab index
# TabIndex maps a page to its tab. qdata on a page is unsafe to
# read and outlives the tab it names.
run: |
if grep -rn 'set_qdata' crates/app/src; then
echo "::error::map a tab page to its tab through TabIndex, not set_qdata"
exit 1
fi
- name: No em dash in user-facing text
# The GNOME writing style leaves the em dash out. Style advice, so
# a match warns and the job goes on. The paths are the ones
# po/POTFILES.in lists. The dash is spelt as its UTF-8 bytes so
# this file holds none. git grep exits 1 for no match, and above 1
# when it could not search at all.
run: |
em_dash=$(printf '\342\200\224')
status=0
git grep -nF "$em_dash" -- 'crates/app/src/*.rs' 'data/resources/*.ui' 'data/*.desktop.in.in' \
'data/*.gschema.xml.in' 'data/*.metainfo.xml.in.in' || status=$?
case "$status" in
0)
echo "::warning::write a comma, a colon or two sentences instead of an em dash"
;;
1) ;;
*)
echo "::error::git grep failed with status $status, so no file was checked"
exit "$status"
;;
esac
- name: Clippy
run: meson devenv -C _build cargo clippy --locked --workspace --all-targets -- -D warnings
- name: Clippy with the in-process SSH transport
run: |
meson devenv -C _build cargo clippy --locked --workspace --all-targets \
--features tablepro-ssh/in-process,tablepro-session/in-process-ssh -- -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
# The package builds run the tests under a soft limit of 1024 open files, and the gtk suite is one process.
run: |
ulimit -Sn 1024
xvfb-run -a dbus-run-session -- meson test -C _build --print-errorlogs
# Meson prints only the last 100 lines of a failed suite, which leaves
# out the names of the tests that failed.
- name: Keep the Meson test log
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: meson-testlog
path: linux/_build/meson-logs/testlog.txt
if-no-files-found: ignore
retention-days: 7
- 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-linux-platform --test secret_service -- --ignored"
- name: Source tarball
run: build-aux/packaging/make-dist.sh _build/dist
# Launchpad builds the PPA package with rustc-X.Y and cargo-X.Y, X.Y being
# the workspace rust-version, so the workspace is checked with that
# compiler and not with rustup's.
msrv:
name: Minimum Rust version
# Nightly, and on a change to a dependency, the toolchain or a manifest.
if: ${{ !inputs.docs-only && (inputs.extended || inputs.dependencies) }}
runs-on: ubuntu-24.04
timeout-minutes: 60
container:
image: ubuntu:26.04
env:
DEBIAN_FRONTEND: noninteractive
defaults:
run:
working-directory: linux
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install the package's build dependencies
# The toolchain comes from ppa:rust-toolchain/staging, as on
# Launchpad. The test-only ones are left out: no test runs here.
# Cargo needs the CA certificates to fetch the crates.
id: toolchain
run: |
version="$(sed -n 's/^rust-version = "\(.*\)"$/\1/p' ../Cargo.toml)"
sh build-aux/packaging/add-rust-toolchain-ppa.sh "$version"
apt-get install -y --no-install-recommends ca-certificates
apt-get build-dep -y --no-install-recommends -P nocheck ./build-aux
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Check with and without default features
env:
RUST_VERSION: ${{ steps.toolchain.outputs.version }}
run: |
"cargo-$RUST_VERSION" check --workspace --all-targets --locked
"cargo-$RUST_VERSION" check --workspace --all-targets --locked --no-default-features
# Every other job builds from paths without a space. Meson hands each path
# to the build as one argument (build-aux/cargo-build.sh), and this checks
# it with a source, build and install directory that each hold one.
spaced-paths:
name: Build from paths with spaces
# Nightly only.
if: ${{ inputs.extended }}
runs-on: ubuntu-24.04
timeout-minutes: 120
container:
image: ubuntu:26.04
env:
DEBIAN_FRONTEND: noninteractive
# The runner passes a step's working directory to docker exec unquoted,
# so each step changes into the source tree itself.
steps:
- name: Install git and the build dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
ca-certificates git curl build-essential pkgconf meson ninja-build gettext \
desktop-file-utils appstream libglib2.0-bin libxml2-utils \
libgtk-4-dev libadwaita-1-dev libgtksourceview-5-dev \
libsqlite3-dev libkrb5-dev liblcms2-dev libseccomp-dev clang libclang-dev
git config --global --add safe.directory "$GITHUB_WORKSPACE/source tree"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
path: source tree
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: "1.98"
- name: Build and install both executables and the completions
run: |
cd "source tree/linux"
meson setup "build dir" -Dprofile=development
meson compile -C "build dir"
DESTDIR="$PWD/install root" meson install -C "build dir" --no-rebuild
test -x "install root/usr/local/bin/tablepro"
test -x "install root/usr/local/libexec/tablepro-askpass"
test -s "install root/usr/local/share/bash-completion/completions/tablepro"
test -s "install root/usr/local/share/zsh/site-functions/_tablepro"
test -s "install root/usr/local/share/fish/vendor_completions.d/tablepro.fish"
supply-chain:
name: Supply chain
if: ${{ !inputs.docs-only }}
runs-on: ubuntu-24.04
timeout-minutes: 30
defaults:
run:
working-directory: linux
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: "1.98"
- uses: taiki-e/install-action@c509219cf42fba86913069efd0ade2458c59337b # v2.90.1
with:
tool: cargo-deny@${{ env.CARGO_DENY_VERSION }},cargo-shear@${{ env.CARGO_SHEAR_VERSION }},cargo-about@${{ env.CARGO_ABOUT_VERSION }}
- name: Bans, licenses and sources
# deny.toml checks every feature, every target the core builds for
# and the dev-dependencies, so a test-only crate is held to the
# same rules. The workspace and deny.toml are at the top.
working-directory: .
run: cargo deny --locked check bans licenses sources
- name: Advisories
# The advisory database changes under unchanged code, so it runs
# nightly and when a dependency changes rather than on every change.
if: ${{ inputs.extended || inputs.dependencies }}
working-directory: .
run: cargo deny --locked check advisories
- name: No unused or misplaced dependencies
working-directory: .
run: cargo shear
- name: Regenerate the notices from Cargo.lock
run: build-aux/update-third-party-licenses.sh
- name: The committed notices cover every shipped crate
# A crate added to or bumped in Cargo.lock changes the regenerated
# files, and so does one whose license text changed. The RPM
# License tag follows data/licenses, and the Debian copyright file
# every crate of Cargo.lock.
run: |
if ! git diff --exit-code -- data/licenses build-aux/debian/copyright build-aux/rpm/tablepro.spec; then
echo "::error::the license files do not match Cargo.lock: run linux/build-aux/update-third-party-licenses.sh and commit the result"
exit 1
fi
i18n:
name: Translations
if: ${{ !inputs.docs-only }}
runs-on: ubuntu-24.04
timeout-minutes: 30
# ubuntu:26.10 ships gettext 1.0, the first release whose xgettext
# reads a call through a path such as crate::i18n::gettext. 0.24 to
# 0.26 read Rust but skip those calls, and an older one falls back to
# its C lexer.
container:
image: ubuntu:26.10
env:
DEBIAN_FRONTEND: noninteractive
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: |
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install system dependencies
run: |
apt-get install -y --no-install-recommends \
build-essential pkgconf meson ninja-build gettext \
desktop-file-utils appstream libglib2.0-bin libglib2.0-dev libxml2-utils \
libgtk-4-dev libadwaita-1-dev libgtksourceview-5-dev \
libsqlite3-dev libkrb5-dev liblcms2-dev libseccomp-dev clang libclang-dev cargo rustc
- name: POTFILES.in is current
run: |
git ls-files 'crates/app/src/*.rs' 'data/resources/*.ui' 'data/*.desktop.in.in' \
'data/*.gschema.xml.in' 'data/*.metainfo.xml.in.in' > po/POTFILES.in
git diff --exit-code po/POTFILES.in
- name: Configure
# Fatal, so an xgettext older than 1.0 fails here.
run: meson setup _build --fatal-meson-warnings
- name: Generate tablepro.pot
run: meson compile -C _build tablepro-pot
# The fast job's gettext 0.23 skips the {name} placeholders that 1.0
# checks in every rust-format entry.
- name: Check the catalogues
run: meson test -C _build --no-rebuild --suite po --print-errorlogs
# Reported, never failed: strings land before the translation run
# after the string freeze. A release refuses the gap
# (release-linux.yml, po/README.md).
- name: Report untranslated entries
run: |
status=0
po/check-complete.sh >> "$GITHUB_STEP_SUMMARY" || status=$?
case "$status" in
0) ;;
1) echo "::warning title=Translations::a language in po/LINGUAS has untranslated or fuzzy entries, which a release refuses (linux/po/README.md)" ;;
*) exit "$status" ;;
esac
# Translators start from this template (po/README.md), since few
# distributions ship gettext 1.0 yet.
- name: Publish tablepro.pot
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: tablepro-pot
path: linux/po/tablepro.pot
if-no-files-found: error
flatpak-devel:
name: Flatpak Devel (${{ matrix.arch }})
# x86_64 on every Linux change. aarch64 nightly, and on a change to a
# dependency, the toolchain or a manifest.
if: ${{ !inputs.docs-only }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON((inputs.extended || inputs.dependencies) && '[{"arch":"x86_64","runner":"ubuntu-24.04"},{"arch":"aarch64","runner":"ubuntu-24.04-arm"}]' || '[{"arch":"x86_64","runner":"ubuntu-24.04"}]') }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 180
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-51
options: --privileged
# Docker copies the image's runtimes into the volume. On AWS-hosted runners, updating a runtime that sits in
# an image layer fails with "Invalid cross-device link" (run 43615225881).
volumes:
- flatpak-system:/var/lib/flatpak
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Every Meson suite runs inside the sandbox, from a source tree with
# no .git. The action gives the tests a display and a session bus.
# On aarch64 the manifest links with lld: rustc links with GNU ld
# there, and its parallel links of the gtk suite ran the runner out
# of memory.
- uses: flatpak/flatpak-github-actions/flatpak-builder@79327416609af08178ad73b352877e51450790b3 # v6.8
with:
manifest-path: linux/build-aux/flatpak/app.tablepro.TablePro.Devel.json
arch: ${{ matrix.arch }}
run-tests: true
build-bundle: false
cache-key: flatpak-devel-${{ matrix.arch }}-${{ hashFiles('Cargo.lock') }}
# The image is built on the linter's own. Only the findings in
# lint-exceptions.json may remain. The repository is not linted: its
# screenshot checks need the mirror only Flathub's build makes.
- name: Lint the manifest
if: ${{ !cancelled() && matrix.arch == 'x86_64' }}
run: |
flatpak-builder-lint --exceptions --user-exceptions linux/build-aux/flatpak/lint-exceptions.json \
manifest linux/build-aux/flatpak/app.tablepro.TablePro.Devel.json
# Each fixture starts its engine's default release (docs/testing.md, Server releases).
integration:
name: Docker tests (${{ matrix.package }})
if: ${{ !inputs.docs-only }}
runs-on: ubuntu-24.04
timeout-minutes: 90
strategy:
fail-fast: false
# GitHub Free runs 20 jobs at once across the account.
max-parallel: 3
# Longest first: with three at a time, a long suite started last ran on alone.
matrix:
package:
- tablepro-driver-mysql
- tablepro-driver-cassandra
- tablepro-driver-mssql
- tablepro-driver-postgres
- tablepro-driver-clickhouse
- tablepro-test-fixtures
- tablepro-driver-mongodb
- tablepro-ssh
- tablepro-driver-redis
include:
- package: tablepro-ssh
apt: openssh-client
features: tablepro-ssh/in-process
- package: tablepro-test-fixtures
apt: openssh-client
defaults:
run:
working-directory: linux
steps:
- &docker-checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- &docker-system
name: Install system dependencies
env:
EXTRA_PACKAGES: ${{ matrix.apt }}
run: |
sudo apt-get update
# shellcheck disable=SC2086 # the matrix names zero or more packages
sudo apt-get install -y build-essential pkg-config $EXTRA_PACKAGES
- &docker-toolchain
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: "1.98"
# Saved from main only: a pull request's cache serves that pull request alone and pushes main's out.
# Without the job's id, the nightly's other server releases reuse each package's cache rather than keep a copy.
- &docker-cache
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: .
key: ${{ matrix.package }}
add-job-id-key: false
save-if: ${{ github.ref == 'refs/heads/main' }}
- &docker-nextest
uses: taiki-e/install-action@c509219cf42fba86913069efd0ade2458c59337b # v2.90.1
with:
tool: cargo-nextest@${{ env.CARGO_NEXTEST_VERSION }}
- &docker-available
name: Verify docker is available
run: docker version
- name: Docker tests
env:
PACKAGE: ${{ matrix.package }}
FEATURES: ${{ matrix.features }}
run: cargo nextest run --locked --profile ci -p "$PACKAGE" ${FEATURES:+--features "$FEATURES"} --run-ignored only
- name: Upload JUnit report
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: junit-${{ matrix.package }}
path: target/nextest/ci/junit.xml
# Nightly: each driver's whole suite again on every other release it supports (docs/testing.md, Server releases).
integration-releases:
name: Docker tests (${{ matrix.package }}, ${{ matrix.release }})
if: ${{ inputs.extended }}
runs-on: ubuntu-24.04
timeout-minutes: 90
strategy:
fail-fast: false
max-parallel: 3
matrix:
include:
- package: tablepro-ssh
release: openssh-9.9
openssh: "9.9"
apt: openssh-client
features: tablepro-ssh/in-process
- package: tablepro-driver-postgres
release: postgres-14
postgres: "14"
- package: tablepro-driver-postgres
release: postgres-15
postgres: "15"
- package: tablepro-driver-postgres
release: postgres-18
postgres: "18"
- package: tablepro-driver-mysql
release: mysql-8.0-mariadb-10.11
mysql: "8.0"
mariadb: "10.11"
- package: tablepro-driver-mysql
release: mysql-9.7-mariadb-12.3
mysql: "9.7"
mariadb: "12.3"
- package: tablepro-driver-mssql
release: mssql-2017
mssql: "2017"
- package: tablepro-driver-mssql
release: mssql-2019
mssql: "2019"
- package: tablepro-driver-mssql
release: mssql-2025
mssql: "2025"
- package: tablepro-driver-clickhouse
release: clickhouse-26.3
clickhouse: "26.3"
- package: tablepro-driver-cassandra
release: cassandra-4.0-scylla-2025.1
cassandra: "4.0"
scylla: "2025.1"
- package: tablepro-driver-redis
release: redis-7.4
redis: "7.4"
- package: tablepro-driver-mongodb
release: mongo-7.0
mongo: "7.0"
defaults:
run:
working-directory: linux
steps:
- *docker-checkout
- *docker-system
- *docker-toolchain
- *docker-cache
- *docker-nextest
- *docker-available
- name: Docker tests
env:
PACKAGE: ${{ matrix.package }}
TABLEPRO_TEST_POSTGRES: ${{ matrix.postgres }}
TABLEPRO_TEST_MYSQL: ${{ matrix.mysql }}
TABLEPRO_TEST_MARIADB: ${{ matrix.mariadb }}
TABLEPRO_TEST_MSSQL: ${{ matrix.mssql }}
TABLEPRO_TEST_CLICKHOUSE: ${{ matrix.clickhouse }}
TABLEPRO_TEST_CASSANDRA: ${{ matrix.cassandra }}
TABLEPRO_TEST_SCYLLA: ${{ matrix.scylla }}
TABLEPRO_TEST_REDIS: ${{ matrix.redis }}
TABLEPRO_TEST_MONGO: ${{ matrix.mongo }}
TABLEPRO_TEST_OPENSSH: ${{ matrix.openssh }}
FEATURES: ${{ matrix.features }}
run: cargo nextest run --locked --profile ci -p "$PACKAGE" ${FEATURES:+--features "$FEATURES"} --run-ignored only
- name: Upload JUnit report
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: junit-${{ matrix.package }}-${{ matrix.release }}
path: 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)
if: ${{ !inputs.docs-only }}
runs-on: ubuntu-24.04
timeout-minutes: 90
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- 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@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: "1.98"
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: .
key: tablepro-session
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: taiki-e/install-action@c509219cf42fba86913069efd0ade2458c59337b # v2.90.1
with:
tool: cargo-nextest@${{ env.CARGO_NEXTEST_VERSION }}
- 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@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: junit-tablepro-session
path: target/nextest/ci/junit.xml
integration-app:
# The app links GTK 4.22 and libadwaita 1.9, which the host runner
# cannot build, so this runs in the fast job's image like the
# session job. Only the named test targets run: the app's startup
# test needs Meson and the fast job already covers it. The library's
# Docker tests put widgets on screen, so they run under Xvfb.
name: Docker tests (tablepro)
if: ${{ !inputs.docs-only }}
runs-on: ubuntu-24.04
timeout-minutes: 90
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install system dependencies
# The -dev packages the app links, as in the fast job, and the
# display and session bus its widget tests run on.
run: |
apt-get install -y --no-install-recommends \
build-essential \
curl \
pkgconf \
libglib2.0-bin \
libgtk-4-dev \
libadwaita-1-dev \
libgtksourceview-5-dev \
libsqlite3-dev \
libkrb5-dev \
liblcms2-dev \
libseccomp-dev \
clang \
libclang-dev \
xvfb \
xauth \
dbus-daemon
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: "1.98"
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: .
key: tablepro-app
save-if: ${{ github.ref == 'refs/heads/main' }}
# As in the fast job: the cache restores DuckDB's sources without files.
- name: Drop the emptied DuckDB sources
run: rm -rf ../target/duckdb-sources
- uses: taiki-e/install-action@c509219cf42fba86913069efd0ade2458c59337b # v2.90.1
with:
tool: cargo-nextest@${{ env.CARGO_NEXTEST_VERSION }}
- 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
# The gtk suite's environment (docs/testing.md, Unit tests).
env:
GSK_RENDERER: cairo
GTK_A11Y: test
GDK_BACKEND: x11
run: |
xvfb-run -a dbus-run-session -- \
cargo nextest run --locked --profile ci -p tablepro --lib --test tracker_save_postgres --run-ignored only
- name: Upload JUnit report
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: junit-tablepro
path: target/nextest/ci/junit.xml