Skip to content

Commit cb42697

Browse files
committed
ci: test compilation against supported qt version / compiler matrix
1 parent 57a5d8e commit cb42697

File tree

7 files changed

+102
-4
lines changed

7 files changed

+102
-4
lines changed

.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ indent_style = tab
99
[*.nix]
1010
indent_style = space
1111
indent_size = 2
12+
13+
[*.{yml,yaml}]
14+
indent_style = space
15+
indent_size = 2

.github/workflows/nix-build.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build (Nix)
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
name: Build (Nix)
7+
strategy:
8+
matrix:
9+
qtver: [qt6.8.0, qt6.7.3, qt6.7.2, qt6.7.1, qt6.7.0, qt6.6.3, qt6.6.2, qt6.6.1, qt6.6.0]
10+
compiler: [clang, gcc]
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
# Use cachix action over detsys for testing with act.
15+
# - uses: cachix/install-nix-action@v27
16+
- uses: DeterminateSystems/nix-installer-action@main
17+
18+
- run: nix-build --no-out-link --expr "(import ./ci/matrix.nix) { qtver = \"$QTVER\"; compiler = \"$COMPILER\"; }"
19+
env:
20+
QTVER: ${{ matrix.qtver }}
21+
COMPILER: ${{ matrix.compiler }}

ci/matrix.nix

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
qtver,
3+
compiler,
4+
}: let
5+
nixpkgs = (import ./nix-checkouts.nix).${builtins.replaceStrings ["."] ["_"] qtver};
6+
compilerOverride = (nixpkgs.callPackage ./variations.nix {}).${compiler};
7+
pkg = (nixpkgs.callPackage ../default.nix {}).override compilerOverride;
8+
in pkg

ci/nix-checkouts.nix

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
let
2+
byCommit = {
3+
commit,
4+
sha256,
5+
}: import (builtins.fetchTarball {
6+
name = "nixpkgs-${commit}";
7+
url = "https://github.com/nixos/nixpkgs/archive/${commit}.tar.gz";
8+
inherit sha256;
9+
}) {};
10+
in {
11+
# For old qt versions, grab the commit before the version bump that has all the patches
12+
# instead of the bumped version.
13+
14+
qt6_8_0 = byCommit {
15+
commit = "23e89b7da85c3640bbc2173fe04f4bd114342367";
16+
sha256 = "1b2v6y3bja4br5ribh9lj6xzz2k81dggz708b2mib83rwb509wyb";
17+
};
18+
19+
qt6_7_3 = byCommit {
20+
commit = "273673e839189c26130d48993d849a84199523e6";
21+
sha256 = "0aca369hdxb8j0vx9791anyzy4m65zckx0lriicqhp95kv9q6m7z";
22+
};
23+
24+
qt6_7_2 = byCommit {
25+
commit = "22165c231d432826094b15062c207f236c5fa9e2";
26+
sha256 = "0ndb6g21xk1wd7ivic5444mf3fnxqjb94b14y9r05431d8zamcf2";
27+
};
28+
29+
qt6_7_1 = byCommit {
30+
commit = "69bee9866a4e2708b3153fdb61c1425e7857d6b8";
31+
sha256 = "1an4sha4jsa29dvc4n9mqxbq8jjwg7frl0rhy085g73m7l1yx0lj";
32+
};
33+
34+
qt6_7_0 = byCommit {
35+
commit = "4fbbc17ccf11bc80002b19b31387c9c80276f076";
36+
sha256 = "09lhgdqlx8j9a7vpdcf8sddlhbzjq0s208spfmxfjdn14fvx8k0j";
37+
};
38+
39+
qt6_6_3 = byCommit {
40+
commit = "8f1a3fbaa92f1d59b09f2d24af6a607b5a280071";
41+
sha256 = "0322zwxvmg8v2wkm03xpk6mqmmbfjgrhc9prcx0zd36vjl6jmi18";
42+
};
43+
44+
qt6_6_2 = byCommit {
45+
commit = "0bb9cfbd69459488576a0ef3c0e0477bedc3a29e";
46+
sha256 = "172ww486jm1mczk9id78s32p7ps9m9qgisml286flc8jffb6yad8";
47+
};
48+
49+
qt6_6_1 = byCommit {
50+
commit = "8eecc3342103c38eea666309a7c0d90d403a039a";
51+
sha256 = "1lakc0immsgrpz3basaysdvd0sx01r0mcbyymx6id12fk0404z5r";
52+
};
53+
54+
qt6_6_0 = byCommit {
55+
commit = "1ded005f95a43953112ffc54b39593ea2f16409f";
56+
sha256 = "1xvyd3lj81hak9j53mrhdsqx78x5v2ppv8m2s54qa2099anqgm0f";
57+
};
58+
}

ci/variations.nix

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
clangStdenv,
3+
gccStdenv,
4+
}: {
5+
clang = { buildStdenv = clangStdenv; };
6+
gcc = { buildStdenv = gccStdenv; };
7+
}

default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
nix-gitignore,
44
pkgs,
55
keepDebugInfo,
6-
buildStdenv ? pkgs.clang17Stdenv,
6+
buildStdenv ? pkgs.clangStdenv,
77

88
cmake,
99
ninja,

flake.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)