From 0391b86eaa266ee2ab2bee4e45e72440a341eee2 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Mon, 24 May 2021 17:18:08 -0700 Subject: [PATCH] Split into separate workflows, add Windows (#9674) --- .github/workflows/compile_test_release.yml | 173 ----------------------------- .github/workflows/linux_debug.yml | 94 ++++++++++++++++ .github/workflows/linux_release.yml | 101 +++++++++++++++++ .github/workflows/macos_release.yml | 96 ++++++++++++++++ .github/workflows/windows_release.yml | 102 +++++++++++++++++ 5 files changed, 393 insertions(+), 173 deletions(-) delete mode 100644 .github/workflows/compile_test_release.yml create mode 100644 .github/workflows/linux_debug.yml create mode 100644 .github/workflows/linux_release.yml create mode 100644 .github/workflows/macos_release.yml create mode 100644 .github/workflows/windows_release.yml diff --git a/.github/workflows/compile_test_release.yml b/.github/workflows/compile_test_release.yml deleted file mode 100644 index 8fb6692..0000000 --- a/.github/workflows/compile_test_release.yml +++ /dev/null @@ -1,173 +0,0 @@ -name: Compile, Test and Release - -on: - push: - branches: - - 'master' - pull_request: - branches: - - '*' - -defaults: - run: - shell: bash - -env: - SOURCE_DIR: ${{ github.workspace }} - -jobs: - build: - name: ${{ matrix.config.name }} - runs-on: ${{ matrix.config.os }} - env: - gst_version: "1.18.1" - - strategy: - fail-fast: false - matrix: - config: - - { - name: "Linux Debug and Test", - os: ubuntu-latest, - qt-host: 'linux', - qt-target: 'desktop', - config: debug, - run-unit-tests: true, - save-artifact: false, - jobs: 2 - } - - { - name: "Linux AppImage", - os: ubuntu-latest, - qt-host: 'linux', - qt-target: 'desktop', - config: installer, - run-unit-tests: false, - artifact: 'QGroundControl.AppImage', - save-artifact: true, - jobs: 2 - } - - { - name: "OSX DMG", - os: macos-latest, - qt-host: 'mac', - qt-target: 'desktop', - config: installer, - run-unit-tests: false, - artifact: 'QGroundControl.dmg', - save-artifact: true, - jobs: 3 - } - - steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Install Qt - uses: jurplel/install-qt-action@v2 - with: - version: '5.12.6' - host: ${{ matrix.config.qt-host }} - target: ${{ matrix.config.qt-target }} - dir: '${{ runner.temp }}' - modules: 'qtcharts' - setup-python: 'false' - - - name: Install QGC source dependencies for Linux - if: ${{ matrix.config.os == 'ubuntu-latest' }} - run: sudo apt-get install -y libsdl2-dev - - - name: Install Gstreamer for Linux - if: ${{ matrix.config.os == 'ubuntu-latest' }} - run: sudo apt-get install -y libgstreamer-plugins-base1.0-dev libgstreamer1.0-0:amd64 libgstreamer1.0-dev - - - name: Install Gstreamer for OSX - if: ${{ matrix.config.os == 'macos-latest' }} - run: | - wget --quiet https://qgroundcontrol.s3-us-west-2.amazonaws.com/dependencies/gstreamer-osx-1.18.1.tar.bz2 && - sudo tar zxf gstreamer-osx-1.18.1.tar.bz2 -C /Library/Frameworks - - - name: Install ccache OSX - if: ${{ matrix.config.os == 'macos-latest' }} - run: brew install ccache - - - name: Install ccache Linux - if: ${{ matrix.config.os == 'ubuntu-latest' }} - run: sudo apt-get install ccache - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) - message("::set-output name=timestamp::${current_date}") - - - name: ccache cache files - uses: actions/cache@v2 - with: - path: ~/.ccache - key: ${{ matrix.config.os }}-${{ matrix.config.config }}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{ matrix.config.os }}-${{ matrix.config.config }}-ccache- - - - name: Setup ccache - run: | - mkdir -p ~/.ccache - echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf - echo "compression = true" >> ~/.ccache/ccache.conf - echo "compression_level = 5" >> ~/.ccache/ccache.conf - ccache -s - ccache -z - - - name: Create build directory - run: mkdir ${{ runner.temp }}/shadow_build_dir - - - name: Build - working-directory: ${{ runner.temp }}/shadow_build_dir - run: | - qmake -r ${SOURCE_DIR}/qgroundcontrol.pro CONFIG+=${{ matrix.config.config }} CONFIG+=DailyBuild - make -j${{ matrix.config.jobs }} - - - name: ccache post-run - run: ccache -s - - - name: Setup for unit tests - if: ${{ matrix.config.run-unit-tests }} - working-directory: ${{ runner.temp }}/shadow_build_dir - run: | - mkdir -p ~/.config/QtProject/ - cp ${SOURCE_DIR}/test/qtlogging.ini ~/.config/QtProject/ - export QT_FATAL_WARNINGS=1 - - - name: Run unit tests - if: ${{ matrix.config.run-unit-tests }} - uses: GabrielBB/xvfb-action@v1 - with: - working-directory: ${{ runner.temp }}/shadow_build_dir - run: ./staging/qgroundcontrol-start.sh --unittest - - - name: Create AppImage - if: ${{ matrix.config.os == 'ubuntu-latest' && matrix.config.config == 'installer' }} - working-directory: ${{ runner.temp }}/shadow_build_dir - run: ${SOURCE_DIR}/deploy/create_linux_appimage.sh ${SOURCE_DIR} ./staging ./package; - - - name: Save artifact - if: ${{ matrix.config.save-artifact }} - uses: actions/upload-artifact@master - with: - name: ${{ matrix.config.artifact }} - path: ${{ runner.temp }}/shadow_build_dir/package/${{ matrix.config.artifact }} - - # Currently disabled since credentials are not working correctly - - name: Upload to S3 Bucket - if: ${{ false && matrix.config.save-artifact && github.event_name == 'push' }} - working-directory: ${{ runner.temp }}/shadow_build_dir/package - run: | - mkdir -p ~/.aws - touch ~/.aws/credentials - echo "[default] - aws_access_key_id = ${{ secrets.AWS_ACCESS_KEY_ID }} - aws_secret_access_key = ${{ secrets.AWS_SECRET_ACCESS_KEY }}" > ~/.aws/credentials - aws s3 cp ./${{ matrix.config.artifact }} s3://groundcontrol/master --region us-west-2 --acl public-read - rm -rf ~/.aws diff --git a/.github/workflows/linux_debug.yml b/.github/workflows/linux_debug.yml new file mode 100644 index 0000000..6d5ecf5 --- /dev/null +++ b/.github/workflows/linux_debug.yml @@ -0,0 +1,94 @@ +name: Linux Debug and Test + +on: + push: + branches: + - 'master' + pull_request: + branches: + - '*' + +defaults: + run: + shell: bash + +env: + SOURCE_DIR: ${{ github.workspace }} + QT_VERSION: 5.12.6 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + version: ${{ env.QT_VERSION }} + host: linux + target: desktop + dir: ${{ runner.temp }} + modules: qtcharts + setup-python: false + + - name: Install QGC source dependencies + run: sudo apt-get install -y libsdl2-dev + + - name: Install Gstreamer dev packages + run: sudo apt-get install -y libgstreamer-plugins-base1.0-dev libgstreamer1.0-0:amd64 libgstreamer1.0-dev + + - name: Install ccache + run: sudo apt-get install ccache + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + + - name: ccache cache files + uses: actions/cache@v2 + with: + path: ~/.ccache + key: ${{ runner.os }}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{ runner.os }}-ccache- + + - name: Setup ccache + run: | + mkdir -p ~/.ccache + echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf + echo "compression = true" >> ~/.ccache/ccache.conf + echo "compression_level = 5" >> ~/.ccache/ccache.conf + ccache -s + ccache -z + + - name: Create build directory + run: mkdir ${{ runner.temp }}/shadow_build_dir + + - name: Build + working-directory: ${{ runner.temp }}/shadow_build_dir + run: | + qmake -r ${SOURCE_DIR}/qgroundcontrol.pro CONFIG+=debug CONFIG+=DailyBuild + make -j2 + + - name: ccache post-run + run: ccache -s + + - name: Setup for unit tests + working-directory: ${{ runner.temp }}/shadow_build_dir + run: | + mkdir -p ~/.config/QtProject/ + cp ${SOURCE_DIR}/test/qtlogging.ini ~/.config/QtProject/ + export QT_FATAL_WARNINGS=1 + + - name: Run unit tests + uses: GabrielBB/xvfb-action@v1 + with: + working-directory: ${{ runner.temp }}/shadow_build_dir + run: ./staging/qgroundcontrol-start.sh --unittest diff --git a/.github/workflows/linux_release.yml b/.github/workflows/linux_release.yml new file mode 100644 index 0000000..f1e42f2 --- /dev/null +++ b/.github/workflows/linux_release.yml @@ -0,0 +1,101 @@ +name: Linux Release + +on: + push: + branches: + - 'master' + pull_request: + branches: + - '*' + +defaults: + run: + shell: bash + +env: + SOURCE_DIR: ${{ github.workspace }} + QT_VERSION: 5.12.6 + ARTIFACT: QGroundControl.AppImage + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + version: ${{ env.QT_VERSION }} + host: linux + target: desktop + dir: ${{ runner.temp }} + modules: qtcharts + setup-python: false + + - name: Install QGC source dependencies + run: sudo apt-get install -y libsdl2-dev + + - name: Install Gstreamer + run: sudo apt-get install -y libgstreamer-plugins-base1.0-dev libgstreamer1.0-0:amd64 libgstreamer1.0-dev + + - name: Install ccache + run: sudo apt-get install ccache + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + + - name: ccache cache files + uses: actions/cache@v2 + with: + path: ~/.ccache + key: ${{ runner.os }}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{ runner.os }}-ccache- + + - name: Setup ccache + run: | + mkdir -p ~/.ccache + echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf + echo "compression = true" >> ~/.ccache/ccache.conf + echo "compression_level = 5" >> ~/.ccache/ccache.conf + ccache -s + ccache -z + + - name: Create build directory + run: mkdir ${{ runner.temp }}/shadow_build_dir + + - name: Build + working-directory: ${{ runner.temp }}/shadow_build_dir + run: | + qmake -r ${SOURCE_DIR}/qgroundcontrol.pro CONFIG+=installer CONFIG+=DailyBuild + make -j2 + + - name: ccache post-run + run: ccache -s + + - name: Create AppImage + working-directory: ${{ runner.temp }}/shadow_build_dir + run: ${SOURCE_DIR}/deploy/create_linux_appimage.sh ${SOURCE_DIR} ./staging ./package; + + - name: Save artifact + uses: actions/upload-artifact@master + with: + name: ${{ env.ARTIFACT }} + path: ${{ runner.temp }}/shadow_build_dir/package/${{ env.ARTIFACT }} + + # Currently disabled since credentials are not working correctly + - name: Upload to S3 Bucket + if: ${{ false }} + working-directory: ${{ runner.temp }}/shadow_build_dir/package + run: | + aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} + aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws s3 cp ${ARTIFACT} s3://groundcontrol/master --region us-west-2 --acl public-read diff --git a/.github/workflows/macos_release.yml b/.github/workflows/macos_release.yml new file mode 100644 index 0000000..d63e15b --- /dev/null +++ b/.github/workflows/macos_release.yml @@ -0,0 +1,96 @@ +name: MacOS Release + +on: + push: + branches: + - 'master' + pull_request: + branches: + - '*' + +defaults: + run: + shell: bash + +env: + SOURCE_DIR: ${{ github.workspace }} + QT_VERSION: 5.12.6 + ARTIFACT: QGroundControl.dmg + +jobs: + build: + runs-on: macos-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + version: ${{ env.QT_VERSION }} + host: mac + target: desktop + dir: ${{ runner.temp }} + modules: qtcharts + setup-python: false + + - name: Install Gstreamer + run: | + wget --quiet https://qgroundcontrol.s3-us-west-2.amazonaws.com/dependencies/gstreamer-osx-1.18.1.tar.bz2 && + sudo tar zxf gstreamer-osx-1.18.1.tar.bz2 -C /Library/Frameworks + + - name: Install ccache + run: brew install ccache + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + + - name: ccache cache files + uses: actions/cache@v2 + with: + path: ~/.ccache + key: ${{ runner.os }}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{ runner.os }}-ccache- + + - name: Setup ccache + run: | + mkdir -p ~/.ccache + echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf + echo "compression = true" >> ~/.ccache/ccache.conf + echo "compression_level = 5" >> ~/.ccache/ccache.conf + ccache -s + ccache -z + + - name: Create build directory + run: mkdir ${{ runner.temp }}/shadow_build_dir + + - name: Build + working-directory: ${{ runner.temp }}/shadow_build_dir + run: | + qmake -r ${SOURCE_DIR}/qgroundcontrol.pro CONFIG+=installer CONFIG+=DailyBuild + make -j3 + + - name: ccache post-run + run: ccache -s + + - name: Save artifact + uses: actions/upload-artifact@master + with: + name: ${{ env.ARTIFACT }} + path: ${{ runner.temp }}/shadow_build_dir/package/${{ env.ARTIFACT }} + + # Currently disabled since credentials are not working correctly + - name: Upload to S3 Bucket + if: ${{ false }} + working-directory: ${{ runner.temp }}/shadow_build_dir/package + run: | + aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} + aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws s3 cp ${ARTIFACT} s3://groundcontrol/master --region us-west-2 --acl public-read diff --git a/.github/workflows/windows_release.yml b/.github/workflows/windows_release.yml new file mode 100644 index 0000000..a6deecf --- /dev/null +++ b/.github/workflows/windows_release.yml @@ -0,0 +1,102 @@ +name: Windows Release + +on: + push: + branches: + - 'master' + pull_request: + branches: + - '*' + +defaults: + run: + shell: cmd + +env: + SOURCE_DIR: ${{ github.workspace }} + QT_VERSION: 5.12.6 + ARTIFACT: QGroundControl-installer.exe + +jobs: + build: + runs-on: windows-2016 + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + version: ${{ env.QT_VERSION }} + host: windows + target: desktop + arch: win64_msvc2017_64 + dir: ${{ runner.temp }} + modules: qtcharts + setup-python: false + + - name: Download JOM + uses: suisei-cn/actions-download-file@v1 + with: + url: http://download.qt.io/official_releases/jom/jom.zip + target: ${{ runner.temp }}\ + + - name: Unzip JOM + working-directory: ${{ runner.temp }} + run: | + 7z x jom.zip -ojom + + - name: Download Gstreamer + uses: suisei-cn/actions-download-file@v1 + with: + url: https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-msvc-x86_64-1.18.1.msi + target: ${{ runner.temp }}\ + + - name: Download Gstreamer dev + uses: suisei-cn/actions-download-file@v1 + with: + url: https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-devel-msvc-x86_64-1.18.1.msi + target: ${{ runner.temp }}\ + + - name: Install Gstreamer + run: | + cmd /c start /wait msiexec /package ${{ runner.temp }}\gstreamer-1.0-msvc-x86_64-1.18.1.msi /passive ADDLOCAL=ALL + cmd /c start /wait msiexec /package ${{ runner.temp }}\gstreamer-1.0-devel-msvc-x86_64-1.18.1.msi /passive ADDLOCAL=ALL + + - name: Create build directory + run: mkdir ${{ runner.temp }}\shadow_build_dir + + - name: Set up Visual Studio shell + uses: egor-tensin/vs-shell@v2 + with: + arch: x64 + + - name: Build + working-directory: ${{ runner.temp }}\shadow_build_dir + run: | + qmake -r ${{ env.SOURCE_DIR }}\qgroundcontrol.pro CONFIG+=installer CONFIG+=DailyBuild + ${{ runner.temp }}\jom\jom -j2 + + - name: Save installer artifact + uses: actions/upload-artifact@master + with: + name: ${{ env.ARTIFACT }} + path: ${{ runner.temp }}\shadow_build_dir\staging\${{ env.ARTIFACT }} + + - name: Save PDB artifact + uses: actions/upload-artifact@master + with: + name: qgroundcontrol.pdb + path: ${{ runner.temp }}\shadow_build_dir\staging\qgroundcontrol.pdb + + # Currently disabled since credentials are not working correctly + - name: Upload to S3 Bucket + if: ${{ false }} + working-directory: ${{ runner.temp }}\shadow_build_dir\staging + run: | + aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} + aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws s3 cp ${ARTIFACT} s3://groundcontrol/master --region us-west-2 --acl public-read