From f64d62d0e9161050a7d346b29ac732e57e9254da Mon Sep 17 00:00:00 2001 From: Miniontoby <47940064+Miniontoby@users.noreply.github.com> Date: Sat, 13 Jun 2026 00:29:32 +0200 Subject: [PATCH] Feature/upload artefacts (#5) Add upload artefact action to all platforms and fix caching issues to reduce actions run time. And combined all workflows into one workflow file for easier monitoring of the progress status. --- .github/workflows/build.yml | 143 ++++++++++++++++++++++++++++ .github/workflows/macos-build.yml | 38 -------- .github/workflows/ubuntu-build.yml | 42 -------- .github/workflows/windows-build.yml | 42 -------- src/src.pri | 2 +- 5 files changed, 144 insertions(+), 123 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/macos-build.yml delete mode 100644 .github/workflows/ubuntu-build.yml delete mode 100644 .github/workflows/windows-build.yml 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