diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..91d4ecee --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,143 @@ +# Build MapMap with Qt 6 +name: Build + +on: + push: + branches: [ dev, master ] + pull_request: + branches: [ dev, master ] + +jobs: + build-windows: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install Qt 6 + uses: jurplel/install-qt-action@v4 + with: + cache: true + version: '6.8.0' + host: 'windows' + target: 'desktop' + arch: 'win64_mingw' + modules: 'qtmultimedia' + tools: 'tools_mingw1310' + + - name: Configure with qmake + run: qmake mapmap.pro CONFIG+=release + + - name: Build + run: mingw32-make -j4 + + - name: Build and run tests + run: | + cd tests/ + qmake6 tests.pro + mingw32-make -j4 + mingw32-make check + env: + QT_QPA_PLATFORM: offscreen + + - name: Deploy Qt + run: windeployqt --release --no-system-d3d-compiler "MapMap\MapMap.exe" + + - uses: actions/upload-artifact@v7 + with: + name: MapMap-windows + path: MapMap/ + + + build-ubuntu: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + libqt6opengl6-dev \ + libqt6openglwidgets6 \ + pkg-config \ + qmake6 \ + qt6-base-dev \ + qt6-multimedia-dev \ + qt6-tools-dev + + - name: Configure with qmake + run: qmake6 mapmap.pro + + - name: Build + run: make -j$(nproc) + + - name: Build and run tests + run: | + cd tests/ + qmake6 tests.pro + make -j$(nproc) + QT_QPA_PLATFORM=offscreen make check + + - uses: actions/upload-artifact@v7 + with: + name: MapMap-ubuntu + path: mapmap + + + build-macos: + runs-on: macos-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Cache Homebrew + id: cache-brew + uses: actions/cache/restore@v5 + with: + path: | + ~/Library/Caches/Homebrew + /opt/homebrew/Cellar/qt + key: brew-${{ runner.os }}-v1 + + - name: Install dependencies + if: steps.cache-brew.outputs.cache-hit != 'true' + run: | + brew install qt + + - name: Configure with qmake + run: | + export PATH="$(brew --prefix qt)/bin:$PATH" + qmake mapmap.pro CONFIG+=release + + - name: Build + run: | + export PATH="$(brew --prefix qt)/bin:$PATH" + make -j$(sysctl -n hw.logicalcpu) + + - name: Build and run tests + run: | + export PATH="$(brew --prefix qt)/bin:$PATH" + cd tests/ + qmake6 tests.pro + make -j$(sysctl -n hw.logicalcpu) + QT_QPA_PLATFORM=offscreen make check + + - uses: actions/upload-artifact@v7 + with: + name: MapMap-macos + path: MapMap.app/ + + - name: Always cache brew + if: always() && steps.cache-brew.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + key: ${{ steps.cache-brew.outputs.cache-primary-key }} + path: | + ~/Library/Caches/Homebrew + /opt/homebrew/Cellar/qt diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml deleted file mode 100644 index c02c708e..00000000 --- a/.github/workflows/macos-build.yml +++ /dev/null @@ -1,38 +0,0 @@ -# Build MapMap on macOS with Qt 6 -name: Build on macOS - -on: - push: - branches: [ dev, master ] - pull_request: - branches: [ dev, master ] - -jobs: - build: - runs-on: macos-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install dependencies - run: | - brew install qt - - - name: Configure with qmake - run: | - export PATH="$(brew --prefix qt)/bin:$PATH" - qmake mapmap.pro CONFIG+=release - - - name: Build - run: | - export PATH="$(brew --prefix qt)/bin:$PATH" - make -j$(sysctl -n hw.logicalcpu) - - - name: Build and run tests - run: | - export PATH="$(brew --prefix qt)/bin:$PATH" - cd tests/ - qmake6 tests.pro - make -j$(sysctl -n hw.logicalcpu) - QT_QPA_PLATFORM=offscreen make check diff --git a/.github/workflows/ubuntu-build.yml b/.github/workflows/ubuntu-build.yml deleted file mode 100644 index 676602c3..00000000 --- a/.github/workflows/ubuntu-build.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Build MapMap on Ubuntu with all dependencies -name: Build on Ubuntu - -on: - push: - branches: [ dev, master ] - pull_request: - branches: [ dev, master ] - -jobs: - build: - runs-on: ubuntu-24.04 - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential \ - libqt6opengl6-dev \ - libqt6openglwidgets6 \ - pkg-config \ - qmake6 \ - qt6-base-dev \ - qt6-multimedia-dev \ - qt6-tools-dev - - - name: Configure with qmake - run: qmake6 mapmap.pro - - - name: Build - run: make -j$(nproc) - - - name: Build and run tests - run: | - cd tests/ - qmake6 tests.pro - make -j$(nproc) - QT_QPA_PLATFORM=offscreen make check diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml deleted file mode 100644 index 50e82586..00000000 --- a/.github/workflows/windows-build.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Build MapMap on Windows with Qt 6 -name: Build on Windows - -on: - push: - branches: [ dev, master ] - pull_request: - branches: [ dev, master ] - -jobs: - build: - runs-on: windows-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Qt 6 - uses: jurplel/install-qt-action@v4 - with: - version: '6.8.0' - host: 'windows' - target: 'desktop' - arch: 'win64_mingw' - modules: 'qtmultimedia' - tools: 'tools_mingw1310' - - - name: Configure with qmake - run: qmake mapmap.pro CONFIG+=release - - - name: Build - run: mingw32-make -j4 - - - name: Build and run tests - run: | - cd tests/ - qmake6 tests.pro - mingw32-make -j4 - mingw32-make check - env: - QT_QPA_PLATFORM: offscreen - diff --git a/src/src.pri b/src/src.pri index 248a3cee..049e1b16 100644 --- a/src/src.pri +++ b/src/src.pri @@ -49,7 +49,7 @@ macx { # Windows-specific: win32 { DEFINES += WIN32 - TARGET = ../../../MapMap/MapMap # Just for release + TARGET = ../MapMap/MapMap # Just for release LIBS += -lopengl32