-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (109 loc) · 3.21 KB
/
build.yml
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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
rust_toolchain: [stable, "1.74"]
exclude:
- os: windows-latest
rust_toolchain: "1.74"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ matrix.rust_toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
- name: Build
run: cargo build --workspace --verbose
- name: Run tests
run: cargo test --workspace --verbose
build-with-qt:
strategy:
matrix:
qt_version: [5, 6]
# ubuntu-latest is not the latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install build dependencies
run: |
sudo apt update
sudo apt install build-essential cmake ninja-build libegl-dev
- if: ${{ matrix.qt_version == 5 }}
name: Install Qt 5
run: sudo apt install qtbase5-dev qttools5-dev qtdeclarative5-dev-tools
- if: ${{ matrix.qt_version == 6 }}
name: Install Qt 6
run: |
sudo apt install qt6-base-dev qt6-tools-dev qt6-declarative-dev-tools
sudo ln -s /usr/bin/qmake6 /usr/local/bin/qmake
- name: Show detected Qt version
run: make help
- name: Build release binaries
run: make release
- name: Install release binaries
run: sudo make install
- name: Build examples
run: make build-examples
build-deb:
# ubuntu-latest is not the latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
path: qmluic
- name: Install build dependencies
run: |
sudo apt update
sudo apt install devscripts equivs
sudo mk-build-deps -i qmluic/contrib/debian/control
- name: Build deb
run: make -C qmluic deb
- uses: actions/upload-artifact@v3
with:
name: ubuntu-22.04-deb
path: qmluic_*.deb
retention-days: 5
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install clippy
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.74"
components: clippy
# TODO: should we switch to actions-rs/clippy-check?
- name: Lint with clippy
run: cargo clippy --workspace --all-targets -- -Dwarnings
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install rustfmt
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check format
run: cargo fmt --all --check
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install clang-format
run: |
sudo apt update
sudo apt install clang-format
- name: Check format
run: find \( -name '*.cpp' -o -name '*.h' \) -print0 | xargs -0 clang-format -n -Werror --