Skip to content

Commit e957e88

Browse files
committed
ci: run lints and test compile on arch
1 parent 9b409c0 commit e957e88

File tree

8 files changed

+86
-28
lines changed

8 files changed

+86
-28
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build
2+
on: [push, pull_request]
3+
4+
jobs:
5+
nix:
6+
name: 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+
- name: Download Dependencies
19+
run: nix-build --no-out-link --expr '((import ./ci/matrix.nix) { qtver = "${{ matrix.qtver }}"; compiler = "${{ matrix.compiler }}"; }).inputDerivation'
20+
21+
- name: Build
22+
run: nix-build --no-out-link --expr '(import ./ci/matrix.nix) { qtver = "${{ matrix.qtver }}"; compiler = "${{ matrix.compiler }}"; }'
23+
24+
archlinux:
25+
name: Archlinux
26+
runs-on: ubuntu-latest
27+
container: archlinux
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Download Dependencies
32+
run: |
33+
pacman --noconfirm --noprogressbar -Syyu
34+
pacman --noconfirm --noprogressbar -Sy \
35+
base-devel \
36+
cmake \
37+
ninja \
38+
pkgconf \
39+
qt6-base \
40+
qt6-declarative \
41+
qt6-svg \
42+
qt6-wayland \
43+
qt6-shadertools \
44+
wayland-protocols \
45+
wayland \
46+
libxcb \
47+
libpipewire \
48+
cli11 \
49+
jemalloc
50+
51+
- name: Build
52+
# breakpad is annoying to build in ci due to makepkg not running as root
53+
run: |
54+
cmake -GNinja -B build -DCRASH_REPORTER=OFF
55+
cmake --build build

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint
2+
on: [push, pull_request]
3+
4+
jobs:
5+
lint:
6+
name: Lint
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
# Use cachix action over detsys for testing with act.
11+
# - uses: cachix/install-nix-action@v27
12+
- uses: DeterminateSystems/nix-installer-action@main
13+
- uses: nicknovitski/nix-develop@v1
14+
15+
- name: Check formatting
16+
run: clang-format -Werror --dry-run src/**/*.{cpp,hpp}
17+
18+
# required for lint
19+
- name: Build
20+
run: |
21+
just configure debug -DNO_PCH=ON -DBUILD_TESTING=ON
22+
just build
23+
24+
- name: Run lints
25+
run: just lint 2>&1

.github/workflows/nix-build.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fmt:
44
find src -type f \( -name "*.cpp" -o -name "*.hpp" \) -print0 | xargs -0 clang-format -i
55

66
lint:
7-
find src -type f -name "*.cpp" -print0 | parallel -q0 --eta clang-tidy --load={{ env_var("TIDYFOX") }}
7+
find src -type f -name "*.cpp" -print0 | parallel -q0 --bar clang-tidy --use-color --load={{ env_var("TIDYFOX") }}
88

99
configure target='debug' *FLAGS='':
1010
cmake -GNinja -B {{builddir}} \

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ in pkgs.mkShell.override { stdenv = quickshell.stdenv; } {
1515

1616
nativeBuildInputs = with pkgs; [
1717
just
18-
clang-tools_17
18+
clang-tools
1919
parallel
2020
makeWrapper
2121
];

src/core/logging.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ bool EncodedLogReader::read(LogMessage* slot) {
626626
if (next == EncodedLogOpcode::RegisterCategory) {
627627
if (!this->registerCategory()) return false;
628628
goto start;
629-
} else if (next == EncodedLogOpcode::RecentMessageShort || next == EncodedLogOpcode::RecentMessageLong)
629+
} else if (next == EncodedLogOpcode::RecentMessageShort
630+
|| next == EncodedLogOpcode::RecentMessageLong)
630631
{
631632
quint8 index = 0;
632633
quint32 secondDelta = 0;

src/core/model.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ class ObjectModel: public UntypedObjectModel {
8585
public:
8686
explicit ObjectModel(QObject* parent): UntypedObjectModel(parent) {}
8787

88-
[[nodiscard]] QVector<T*>& valueList() {
89-
return *std::bit_cast<QVector<T*>*>(&this->valuesList);
90-
}
88+
[[nodiscard]] QVector<T*>& valueList() { return *std::bit_cast<QVector<T*>*>(&this->valuesList); }
9189

9290
[[nodiscard]] const QVector<T*>& valueList() const {
9391
return *std::bit_cast<const QVector<T*>*>(&this->valuesList);

src/x11/panel_window.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ void XPanelWindow::getExclusion(int& side, quint32& exclusiveZone) {
366366
{
367367
side = anchors.mLeft ? 0 : anchors.mRight ? 1 : -1;
368368
} else if (!anchors.verticalConstraint()
369-
&& (anchors.horizontalConstraint() || (!anchors.mLeft && !anchors.mRight)))
369+
&& (anchors.horizontalConstraint() || (!anchors.mLeft && !anchors.mRight)))
370370
{
371371
side = anchors.mTop ? 2 : anchors.mBottom ? 3 : -1;
372372
}

0 commit comments

Comments
 (0)