diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml new file mode 100644 index 00000000000..d0305d3832e --- /dev/null +++ b/.github/actions/cache/action.yml @@ -0,0 +1,71 @@ +name: Caching +description: Setup Caching +inputs: + host: + description: Host OS + required: true + target: + description: Target OS + required: true + build-type: + description: Build Type + required: true + cpm-modules: + description: Path to CPM Modules + required: false + default: $GITHUB_WORKSPACE/cpm-modules + ccache-version: + description: ccache Version to Install + required: false + default: 4.10.2 + # windows-x86_64.zip, darwin.tar.gz, linux-x86_64.tar.xz + # https://github.com/ccache/ccache/releases/download/${version}/ccache-${version}-${host}.${zip} +runs: + using: "composite" + steps: + - name: Install ccache (Linux) + if: runner.os == 'Linux' + shell: bash + run: | + set -e + echo "Downloading ccache..." + wget --quiet https://github.com/ccache/ccache/releases/download/v${{ inputs.ccache-version }}/ccache-${{ inputs.ccache-version }}-linux-x86_64.tar.xz + echo "Extracting archive..." + tar -xvf ccache-${{ inputs.ccache-version }}-linux-x86_64.tar.xz + cd ccache-${{ inputs.ccache-version }}-linux-x86_64 + echo "Installing ccache..." + sudo make install + + - name: Setup sccache (Windows) + if: runner.os == 'Windows' + uses: mozilla-actions/sccache-action@v0.0.7 + + - run: echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV" + if: runner.os == 'Windows' + shell: bash + + - name: Setup Build Cache + uses: hendrikmuhs/ccache-action@main + with: + create-symlink: ${{ runner.os != 'Windows' }} + variant: ${{ runner.os == 'Windows' && 'sccache' || 'ccache' }} + key: ${{ inputs.host }}-ccache-${{ inputs.target }}-${{ inputs.build-type }} + restore-keys: | + ${{ inputs.host }}-ccache-${{ inputs.target }} + ${{ inputs.host }}-ccache- + max-size: 1G + verbose: 1 + evict-old-files: job + + - name: Ensure cpm-modules directory exists (Linux/macOS) + run: mkdir -p "${{ inputs.cpm-modules }}" + shell: bash + + - name: Cache CPM Modules + if: (inputs.cpm-modules != '') + uses: actions/cache@v4 + with: + path: ${{ inputs.cpm-modules }} + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ github.workflow }}-cpm-modules- + enableCrossOsArchive: true diff --git a/.github/actions/checkout/action.yml b/.github/actions/checkout/action.yml deleted file mode 100644 index 329867e02dd..00000000000 --- a/.github/actions/checkout/action.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Checkout Repository -description: Checks out the QGC repo with all the correct settings -runs: - using: "composite" - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-tags: true - fetch-depth: 0 diff --git a/.github/actions/common/action.yml b/.github/actions/common/action.yml new file mode 100644 index 00000000000..1943ae3c990 --- /dev/null +++ b/.github/actions/common/action.yml @@ -0,0 +1,12 @@ +name: Common Setup +description: Common Setup for All Runners +runs: + using: "composite" + steps: + - uses: lukka/get-cmake@latest + - uses: actions/setup-python@v5 + with: + python-version: '>=3.9.x' + + - run: mkdir $RUNNER_TEMP/shadow_build_dir + shell: bash diff --git a/.github/actions/qt-android/action.yml b/.github/actions/qt-android/action.yml index f494843b535..374910021af 100644 --- a/.github/actions/qt-android/action.yml +++ b/.github/actions/qt-android/action.yml @@ -18,7 +18,7 @@ inputs: cpm-cache: description: CPM Cache Path required: false - default: ${{ github.workspace }}/cpm_modules + default: $GITHUB_WORKSPACE/cpm_modules runs: using: "composite" steps: @@ -27,6 +27,10 @@ runs: with: distribution: temurin java-version: 17 + cache: 'gradle' + cache-dependency-path: | + **/*.gradle* + **/gradle-wrapper.properties - name: Setup Android Environment uses: android-actions/setup-android@v3 @@ -53,20 +57,13 @@ runs: run: sdkmanager --update shell: bash - - name: Set Up Cache - uses: hendrikmuhs/ccache-action@main + - name: Setup Caching + uses: ./.github/actions/cache with: - create-symlink: ${{ runner.os != 'Windows' }} - key: ${{ runner.os }}-Android-${{ matrix.BuildType }} - max-size: 1G - save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - verbose: 1 - evict-old-files: 'job' - - - uses: actions/cache@v4 - with: - path: ${{ inputs.cpm-cache }} - key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + host: ${{ inputs.host }} + target: ${{ inputs.arch }} + build-type: ${{ matrix.BuildType }} + cpm-modules: ${{ inputs.cpm-cache }} - name: Install Qt for ${{ runner.os }} uses: jurplel/install-qt-action@v4 @@ -77,7 +74,7 @@ runs: arch: ${{ inputs.arch }} dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + setup-python: false - name: Install Qt for Android (armv7) if: contains( inputs.abis, 'armeabi-v7a') @@ -89,7 +86,7 @@ runs: arch: android_armv7 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + setup-python: false - name: Install Qt for Android (arm64_v8a) if: contains( inputs.abis, 'arm64-v8a') @@ -101,7 +98,7 @@ runs: arch: android_arm64_v8a dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + setup-python: false - name: Install Qt for Android (x86) if: contains( inputs.abis, 'x86') @@ -113,7 +110,7 @@ runs: arch: android_x86 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + setup-python: false - name: Install Qt for Android (x86_64) if: contains( inputs.abis, 'x86_64') @@ -125,4 +122,4 @@ runs: arch: android_x86_64 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + setup-python: false diff --git a/.github/workflows/android-linux.yml b/.github/workflows/android-linux.yml index 77e4c2dfb75..23bee6d66af 100644 --- a/.github/workflows/android-linux.yml +++ b/.github/workflows/android-linux.yml @@ -49,17 +49,9 @@ jobs: with: submodules: recursive fetch-tags: true - fetch-depth: 0 - - uses: seanmiddleditch/gha-setup-ninja@v5 - - uses: lukka/get-cmake@latest - - - name: Install CCache - run: | - wget --quiet https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-linux-x86_64.tar.xz - tar -xvf ccache-*-linux-x86_64.tar.xz - cd ccache-*-linux-x86_64 - sudo make install + - name: Initial Setup + uses: ./.github/actions/common - name: Install Qt for Android uses: ./.github/actions/qt-android @@ -70,8 +62,6 @@ jobs: abis: ${{ env.QT_ANDROID_ABIS }} cpm-cache: ${{ env.CPM_SOURCE_CACHE }} - - run: mkdir ${{ runner.temp }}/shadow_build_dir - - name: Configure working-directory: ${{ runner.temp }}/shadow_build_dir run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja @@ -82,7 +72,6 @@ jobs: -DQT_ANDROID_SIGN_APK=${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && 'ON' || 'OFF' }} -DQT_DEBUG_FIND_PACKAGE=ON -DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }} - -DCPM_SOURCE_CACHE=${{ env.CPM_SOURCE_CACHE }} - name: Build working-directory: ${{ runner.temp }}/shadow_build_dir diff --git a/.github/workflows/android-macos.yml b/.github/workflows/android-macos.yml index 59e5d3d2e05..e8e54f02c47 100644 --- a/.github/workflows/android-macos.yml +++ b/.github/workflows/android-macos.yml @@ -36,16 +36,9 @@ jobs: with: submodules: recursive fetch-tags: true - fetch-depth: 0 - - uses: seanmiddleditch/gha-setup-ninja@v5 - - uses: lukka/get-cmake@latest - - - name: Install Dependencies - run: | - brew update - brew install ccache - continue-on-error: true + - name: Initial Setup + uses: ./.github/actions/common - name: Install Qt for Android uses: ./.github/actions/qt-android @@ -56,8 +49,6 @@ jobs: abis: ${{ env.QT_ANDROID_ABIS }} cpm-cache: ${{ env.CPM_SOURCE_CACHE }} - - run: mkdir ${{ runner.temp }}/shadow_build_dir - - name: Configure working-directory: ${{ runner.temp }}/shadow_build_dir run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja @@ -68,7 +59,6 @@ jobs: -DQT_ANDROID_SIGN_APK=${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && 'ON' || 'OFF' }} -DQT_DEBUG_FIND_PACKAGE=ON -DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }} - -DCPM_SOURCE_CACHE=${{ env.CPM_SOURCE_CACHE }} - name: Build working-directory: ${{ runner.temp }}/shadow_build_dir diff --git a/.github/workflows/android-windows.yml b/.github/workflows/android-windows.yml index 19f3e33f313..69abb5b6e33 100644 --- a/.github/workflows/android-windows.yml +++ b/.github/workflows/android-windows.yml @@ -41,7 +41,7 @@ jobs: QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} QT_ANDROID_KEYSTORE_KEY_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} QT_ANDROID_ABIS: 'arm64-v8a' - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + CPM_SOURCE_CACHE: ${{ github.workspace }}\cpm_modules steps: - name: Checkout repo @@ -49,13 +49,9 @@ jobs: with: submodules: recursive fetch-tags: true - fetch-depth: 0 - - uses: seanmiddleditch/gha-setup-ninja@v5 - - uses: lukka/get-cmake@latest - - - name: Update ccache - run: choco install ccache + - name: Initial Setup + uses: ./.github/actions/common - name: Install Qt for Android uses: ./.github/actions/qt-android @@ -71,8 +67,6 @@ jobs: with: arch: x64 - - run: mkdir ${{ runner.temp }}\shadow_build_dir - - name: Configure working-directory: ${{ runner.temp }}/shadow_build_dir run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja @@ -83,7 +77,6 @@ jobs: -DQT_ANDROID_SIGN_APK=OFF -DQT_DEBUG_FIND_PACKAGE=ON -DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }} - -DCPM_SOURCE_CACHE=${{ env.CPM_SOURCE_CACHE }} - name: Build working-directory: ${{ runner.temp }}/shadow_build_dir diff --git a/.github/workflows/custom.yml b/.github/workflows/custom.yml index 6cf8cbb5fe8..53f6a3a8f6d 100644 --- a/.github/workflows/custom.yml +++ b/.github/workflows/custom.yml @@ -36,7 +36,7 @@ jobs: ARTIFACT: QGroundControl-installer.exe QT_VERSION: 6.8.1 GST_VERSION: 1.22.12 - SCCACHE_GHA_ENABLED: "true" + CPM_SOURCE_CACHE: ${{ github.workspace }}\cpm_modules steps: - name: Checkout repo @@ -44,7 +44,9 @@ jobs: with: submodules: recursive fetch-tags: true - fetch-depth: 0 + + - name: Initial Setup + uses: ./.github/actions/common - name: Enable custom build run: | @@ -53,25 +55,18 @@ jobs: ) xcopy /E /I ".\custom-example" ".\custom" - - uses: seanmiddleditch/gha-setup-ninja@v5 - - uses: lukka/get-cmake@latest - - name: Install GStreamer uses: blinemedical/setup-gstreamer@v1 with: version: ${{ env.GST_VERSION }} - - name: Set Up SCCache - uses: mozilla-actions/sccache-action@v0.0.7 - - - name: Set Up Cache - uses: hendrikmuhs/ccache-action@main + - name: Setup Caching + uses: ./.github/actions/cache with: - key: ${{ runner.os }}-${{ matrix.Arch }}-${{ matrix.BuildType }}-custom - max-size: 1G - variant: sccache - save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - verbose: 1 + host: windows + target: win64_msvc2022_64 + build-type: ${{ matrix.BuildType }} + cpm-modules: ${{ env.CPM_SOURCE_CACHE }} - name: Install Qt for Windows (x64) if: matrix.Arch == 'x64' @@ -84,15 +79,12 @@ jobs: arch: win64_msvc2022_64 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - name: Set up Visual Studio shell uses: ilammy/msvc-dev-cmd@v1 with: arch: x64 - - run: mkdir ${{ runner.temp }}\shadow_build_dir - - name: Configure working-directory: ${{ runner.temp }}\shadow_build_dir run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index cb43eab361e..bfb54fab705 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -32,35 +32,22 @@ jobs: with: submodules: recursive fetch-tags: true - fetch-depth: 0 + + - name: Initial Setup + uses: ./.github/actions/common - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - - uses: seanmiddleditch/gha-setup-ninja@v5 - - uses: lukka/get-cmake@latest - - - name: Install Dependencies - run: | - brew update - brew install ccache - - - name: Set Up Cache - uses: hendrikmuhs/ccache-action@main - with: - create-symlink: true - key: ${{ runner.os }}-iOS-${{ matrix.BuildType }} - max-size: 1G - save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - verbose: 1 - evict-old-files: 'job' - - - uses: actions/cache@v4 + - name: Setup Caching + uses: ./.github/actions/cache with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + host: mac + target: ios + build-type: ${{ matrix.BuildType }} + cpm-modules: ${{ env.CPM_SOURCE_CACHE }} - name: Install Qt for MacOS uses: jurplel/install-qt-action@v4 @@ -71,7 +58,6 @@ jobs: arch: clang_64 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - name: Install Qt for iOS uses: jurplel/install-qt-action@v4 @@ -82,9 +68,6 @@ jobs: arch: ios dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - - - run: mkdir ${{ runner.temp }}/shadow_build_dir - name: Configure working-directory: ${{ runner.temp }}/shadow_build_dir @@ -92,7 +75,6 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }} -DQT_HOST_PATH="${{ env.QT_ROOT_DIR }}/../macos" -DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }} - -DCPM_SOURCE_CACHE=${{ env.CPM_SOURCE_CACHE }} - name: Build working-directory: ${{ runner.temp }}/shadow_build_dir diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 108d0f2bca5..e2df8e1060a 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -44,16 +44,15 @@ jobs: with: submodules: recursive fetch-tags: true - fetch-depth: 0 + + - name: Initial Setup + uses: ./.github/actions/common - name: Install Dependencies run: | chmod a+x ./tools/setup/install-dependencies-debian.sh sudo ./tools/setup/install-dependencies-debian.sh - - uses: lukka/get-cmake@latest - - uses: seanmiddleditch/gha-setup-ninja@v5 - - name: Install Vulkan run: | wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc @@ -68,27 +67,13 @@ jobs: sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 sudo update-alternatives --set gcc /usr/bin/gcc-11 - - name: Install CCache - run: | - wget --quiet https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-linux-x86_64.tar.xz - tar -xvf ccache-*-linux-x86_64.tar.xz - cd ccache-*-linux-x86_64 - sudo make install - - - name: Set Up Cache - uses: hendrikmuhs/ccache-action@main + - name: Setup Caching + uses: ./.github/actions/cache with: - create-symlink: true - key: ${{ runner.os }}-${{ matrix.BuildType }} - max-size: 1G - save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - verbose: 1 - evict-old-files: 'job' - - - uses: actions/cache@v4 - with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + host: linux + target: linux_gcc_64 + build-type: ${{ matrix.BuildType }} + cpm-modules: ${{ env.CPM_SOURCE_CACHE }} - name: Install Qt for Linux (x64) uses: jurplel/install-qt-action@v4 @@ -99,20 +84,16 @@ jobs: arch: linux_gcc_64 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} # - name: Build GStreamer # uses: ./.github/actions/gstreamer - - run: mkdir ${{ runner.temp }}/shadow_build_dir - - name: Configure working-directory: ${{ runner.temp }}/shadow_build_dir run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }} -DQGC_BUILD_TESTING=${{ matrix.BuildType == 'Debug' && 'ON' || 'OFF' }} -DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }} - -DCPM_SOURCE_CACHE=${{ env.CPM_SOURCE_CACHE }} - name: Build working-directory: ${{ runner.temp }}/shadow_build_dir diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1080acffb9a..c13b3b3e780 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -43,22 +43,19 @@ jobs: with: submodules: recursive fetch-tags: true - fetch-depth: 0 + + - name: Initial Setup + uses: ./.github/actions/common - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - - uses: seanmiddleditch/gha-setup-ninja@v5 - - name: Install Dependencies working-directory: ${{ github.workspace }}/tools/setup run: sh macos-dependencies.sh - - uses: lukka/get-cmake@latest - - uses: seanmiddleditch/gha-setup-ninja@v5 - - name: Install GStreamer run: | wget --quiet https://gstreamer.freedesktop.org/data/pkg/osx/${{ env.GST_VERSION }}/gstreamer-1.0-devel-${{ env.GST_VERSION }}-universal.pkg @@ -68,20 +65,13 @@ jobs: done echo "PKG_CONFIG_PATH=/Library/Frameworks/GStreamer.framework/lib/pkgconfig:/Library/Frameworks/GStreamer.framework/lib/gstreamer-1.0/pkgconfig:${{ env.PKG_CONFIG_PATH }}" >> "$GITHUB_ENV" - - name: Set Up Cache - uses: hendrikmuhs/ccache-action@main + - name: Setup Caching + uses: ./.github/actions/cache with: - create-symlink: true - key: ${{ runner.os }}-${{ matrix.BuildType }} - max-size: 1G - save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - verbose: 1 - evict-old-files: 'job' - - - uses: actions/cache@v4 - with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + host: mac + target: clang_64 + build-type: ${{ matrix.BuildType }} + cpm-modules: ${{ env.CPM_SOURCE_CACHE }} - name: Install Qt uses: jurplel/install-qt-action@v4 @@ -92,7 +82,6 @@ jobs: arch: clang_64 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - name: Import Code Signing Certificate if: github.event_name != 'pull_request' @@ -101,8 +90,6 @@ jobs: p12-file-base64: ${{ secrets.MACOS_SIGNING_CERTS_P12 }} p12-password: ${{ secrets.MACOS_SIGNING_CERTS_PASS }} - - run: mkdir ${{ runner.temp }}/shadow_build_dir - - name: Configure working-directory: ${{ runner.temp }}/shadow_build_dir run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja @@ -110,7 +97,6 @@ jobs: -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DMACOS_SIGNING_IDENTITY=${{ secrets.MACOS_SIGNING_IDENTITY }} -DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }} - -DCPM_SOURCE_CACHE=${{ env.CPM_SOURCE_CACHE }} - name: Build working-directory: ${{ runner.temp }}/shadow_build_dir diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2eb59eb593f..3d8706151bd 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -36,8 +36,7 @@ jobs: PACKAGE: QGroundControl-installer QT_VERSION: 6.8.1 GST_VERSION: 1.22.12 - SCCACHE_GHA_ENABLED: "true" - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + CPM_SOURCE_CACHE: ${{ github.workspace }}\cpm_modules steps: - name: Checkout repo @@ -45,10 +44,9 @@ jobs: with: submodules: recursive fetch-tags: true - fetch-depth: 0 - - uses: seanmiddleditch/gha-setup-ninja@v5 - - uses: lukka/get-cmake@latest + - name: Initial Setup + uses: ./.github/actions/common - name: Install Vulkan working-directory: ${{ runner.temp }} @@ -63,21 +61,13 @@ jobs: with: version: ${{ env.GST_VERSION }} - - name: Set Up sccache - uses: mozilla-actions/sccache-action@v0.0.7 - - - name: Set Up Cache - uses: hendrikmuhs/ccache-action@main - with: - key: ${{ runner.os }}-${{ matrix.Arch }}-${{ matrix.BuildType }} - max-size: 1G - variant: sccache - save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - - - uses: actions/cache@v4 + - name: Setup Caching + uses: ./.github/actions/cache with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + host: windows + target: win64_msvc2022_64 + build-type: ${{ matrix.BuildType }} + cpm-modules: ${{ env.CPM_SOURCE_CACHE }} - name: Install Qt for Windows (x64) uses: jurplel/install-qt-action@v4 @@ -89,7 +79,6 @@ jobs: arch: win64_msvc2022_64 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} # Note: Must Use QtMultimedia VideoReceiver or build GStreamer manually - name: Install Qt for Windows (Arm64) @@ -103,15 +92,12 @@ jobs: arch: win64_msvc2022_arm64_cross_compiled dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors - cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - name: Set up Visual Studio shell uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.Arch == 'Arm64' && 'amd64_arm64' || 'x64' }} - - run: mkdir ${{ runner.temp }}\shadow_build_dir - - name: Configure working-directory: ${{ runner.temp }}\shadow_build_dir run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja @@ -119,7 +105,6 @@ jobs: -DQT_HOST_PATH="${{ env.QT_ROOT_DIR }}/../msvc2022_64" -DQT_DEBUG_FIND_PACKAGE=ON -DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }} - -DCPM_SOURCE_CACHE=${{ env.CPM_SOURCE_CACHE }} - name: Build working-directory: ${{ runner.temp }}\shadow_build_dir diff --git a/cmake/find-modules/FindGStreamer.cmake b/cmake/find-modules/FindGStreamer.cmake index b221a76b8e0..d3bec48df1f 100644 --- a/cmake/find-modules/FindGStreamer.cmake +++ b/cmake/find-modules/FindGStreamer.cmake @@ -85,11 +85,11 @@ elseif(ANDROID) set(GSTREAMER_URL "https://gstreamer.freedesktop.org/data/pkg/android/${QGC_GST_TARGET_VERSION}/${GSTREAMER_ARCHIVE}") set(GSTREAMER_TARBALL "${CMAKE_BINARY_DIR}/_deps/gstreamer/${GSTREAMER_ARCHIVE}") set(GSTREAMER_INSTALL_DIR "${CMAKE_BINARY_DIR}/_deps/gstreamer/install/gstreamer") - if(NOT EXISTS ${GSTREAMER_TARBALL}) - message(STATUS "Downloading GStreamer from ${GSTREAMER_URL}") - file(DOWNLOAD ${GSTREAMER_URL} ${GSTREAMER_TARBALL} SHOW_PROGRESS) - endif() if(NOT EXISTS ${GSTREAMER_INSTALL_DIR}) + if(NOT EXISTS ${GSTREAMER_TARBALL}) + message(STATUS "Downloading GStreamer from ${GSTREAMER_URL}") + file(DOWNLOAD ${GSTREAMER_URL} ${GSTREAMER_TARBALL} SHOW_PROGRESS) + endif() message(STATUS "Extracting GStreamer to ${GSTREAMER_INSTALL_DIR}") file(MAKE_DIRECTORY ${GSTREAMER_INSTALL_DIR}) file(ARCHIVE_EXTRACT INPUT ${GSTREAMER_TARBALL} DESTINATION ${GSTREAMER_INSTALL_DIR}) diff --git a/tools/setup/install-dependencies-debian.sh b/tools/setup/install-dependencies-debian.sh index 13bb97e9a4d..481ac808e0b 100755 --- a/tools/setup/install-dependencies-debian.sh +++ b/tools/setup/install-dependencies-debian.sh @@ -30,6 +30,7 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ python3 \ python3-pip \ rsync \ + wget2 \ zsync # Qt Required - https://doc.qt.io/qt-6/linux-requirements.html