Skip to content

Commit

Permalink
ci: 自动构建流程
Browse files Browse the repository at this point in the history
  • Loading branch information
mhduiy committed Jun 29, 2024
1 parent 400f22d commit 6ea3751
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 8 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/compile-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Compile project

on:
push:
branches: [ "linux" ]
pull_request:
branches: [ "linux" ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install dependences
run: |
sudo apt-get update
sudo apt-get build-dep . -y
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j4
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ debian/*
!debian/changelog
!debian/control
!debian/rules
obj-*-linux-gnu
obj-*-linux-gnu
.cache
13 changes: 12 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@ Maintainer: mhduiy
Build-Depends:
debhelper-compat ( =12),
cmake,
extra-cmake-modules,
build-essential,
qt6-base-dev,
qt6-declarative-dev,
qt6-base-dev-tools,
qt6-tools-dev,
qtquickcontrols2-5-dev,
qml6-module-qtquick-layouts,
qml6-module-qtquick-window,
qml6-module-qt-labs-platform,
qml6-module-qtquick-controls2-styles-chameleon
libopengl-dev,
libgl-dev,
libxkbcommon-dev,
libxkbfile-dev,
libgl1-mesa-dev,
libglu1-mesa-dev,
mesa-common-dev,
libvulkan-dev,
libqt6opengl6-dev

Standards-Version: 0.0.1


Expand Down
3 changes: 0 additions & 3 deletions example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ int main(int argc, char *argv[])

QQmlApplicationEngine engine;
const QUrl url("qrc:/example/Main.qml");
QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
&app, []() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.load(url);

return app.exec();
Expand Down
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ set_target_properties(${LIB_NAME} PROPERTIES
)

target_link_libraries(${LIB_NAME} PUBLIC
Qt${QT_VERSION_MAJOR}::CorePrivate
Qt${QT_VERSION_MAJOR}::QuickPrivate
Qt${QT_VERSION_MAJOR}::QmlPrivate
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::Qml
)

# Install library
Expand Down

0 comments on commit 6ea3751

Please sign in to comment.