Skip to content

Commit

Permalink
CI: modify ci
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Jan 21, 2024
1 parent 411a75c commit dd77be7
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 121 deletions.
58 changes: 30 additions & 28 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,29 @@ jobs:
strategy:
matrix:
BUILD_TYPE: [Release]
qt_arch: [android_arm64_v8a, android_armv7, android_x86_64, android_x86]
qt_arch: [android_arm64_v8a, android_x86_64]
qt_version: [6.6.1]
include:
- BUILD_TYPE: Release
qt_arch: android_arm64_v8a
VCPKG_TARGET_TRIPLET: arm-android

- BUILD_TYPE: Release
qt_arch: android_armv7
VCPKG_TARGET_TRIPLET: arm-android
VCPKG_TARGET_TRIPLET: arm64-android

- BUILD_TYPE: Release
qt_arch: android_x86_64
VCPKG_TARGET_TRIPLET: x64-android

- BUILD_TYPE: Release
qt_arch: android_x86
VCPKG_TARGET_TRIPLET: x32-android

runs-on: ubuntu-latest

env:
artifact_name: build_android
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_${{matrix.BUILD_TYPE}}_${{matrix.qt_arch}}
INSTALL_DIR: ${{github.workspace}}/.cache/install
SerialPortAssistant_VERSION: v0.5.16
VCPKGGITCOMMITID: 6359372f3ca1e6072e302e1d7238f31b259c5b51
VCPKGGITCOMMITID: a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6
ANDROID_PLATFORM: android-23
ANDROID_NATIVE_API_LEVEL: 23
qt_modules: qtscxml qtserialport qtwebview
qt_modules: 'qtscxml qtserialport qtwebchannel qtwebsockets qtwebview'

# Map the job outputs to step outputs
outputs:
Expand All @@ -68,32 +60,33 @@ jobs:
with:
path: |
${{env.INSTALL_DIR}}
key: cache-installed-android-qt${{matrix.qt_version}}-${{matrix.VCPKG_TARGET_TRIPLET}}-${{matrix.BUILD_TYPE}}
key: installed-qt${{matrix.qt_version}}-${{matrix.qt_arch}}-${{matrix.triplet}}

- name: Cache Qt
#if: false
if: false
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
path: ${{env.TOOSL_DIR}}/qt
key: qt${{matrix.qt_version}}_${{matrix.qt_arch}}
key: -qt${{matrix.qt_version}}-${{matrix.qt_arch}}-${{matrix.triplet}}

- name: Install Qt of gcc_64
uses: jurplel/install-qt-action@v3
with:
dir: '${{env.TOOSL_DIR}}/qt' # optional
dir: '${{env.TOOSL_DIR}}' # optional
version: '${{matrix.qt_version}}'
#host: 'linux'
target: 'desktop'
arch: 'gcc_64'
set-env: false
cached: '${{ steps.cache-qt.outputs.cache-hit }}' # optional, default is false
cache: true
cache-key-prefix: install-qt-action

- name: Install Qt of android
uses: jurplel/install-qt-action@v3
with:
# Directory to install Qt
dir: '${{env.TOOSL_DIR}}/qt' # optional
dir: '${{env.TOOSL_DIR}}' # optional
# Version of Qt to install
version: '${{matrix.qt_version}}'
# Host platform
Expand All @@ -104,23 +97,33 @@ jobs:
arch: '${{matrix.qt_arch}}' # optional
# Additional Qt modules to install
modules: '${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
cached: '${{ steps.cache-qt.outputs.cache-hit }}' # optional, default is false
# Whether or not to actually download Qt
cache: true
cache-key-prefix: install-qt-action

- name: Cache vcpkg
if: false
uses: actions/cache@v2
id: cache-vcpkg
with:
path: |
${{ runner.workspace }}/vcpkg/
key: cache-vcpkg

- name: run-vcpkg
if: false
uses: lukka/run-vcpkg@v7.4
uses: lukka/run-vcpkg@v11
with:
# Indicates whether to only setup vcpkg (i.e. installing it and setting the environment variables VCPKG_ROOT, RUNVCPK_VCPKG_ROOT), without installing any port.
#setupOnly: # optional
#vcpkgGitURL: https://github.com/KangLin/vcpkg.git
vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}}
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
# Since the cache must be invalidated when content of the vcpkg.json file changes, let's
# compute its hash and append this to the computed cache's key.
appendedCacheKey: android_${{matrix.os}}-qt${{matrix.qt_version}}-${{matrix.VCPKG_TARGET_TRIPLET}}-${{matrix.BUILD_TYPE}}-${{env.VCPKGGITCOMMITID}}
additionalCachedPaths: $VCPKG_ROOT/installed
vcpkgTriplet: '${{ matrix.VCPKG_TARGET_TRIPLET }}'
vcpkgArguments: 'openssl'

- name: run vcpkg
if: false
run: |
vcpkg install --triplet=${{matrix.triplet}}
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
Expand All @@ -131,7 +134,6 @@ jobs:
working-directory: ${{github.workspace}}/build
env:
RabbitCommon_DIR: ${{env.SOURCE_DIR}}/RabbitCommon
QT_ROOT: ${{env.Qt5_DIR}}
QT_ANDROID_KEYSTORE_PATH: ${{env.SOURCE_DIR}}/RabbitCommon/RabbitCommon.keystore
QT_ANDROID_KEYSTORE_ALIAS: rabbitcommon
QT_ANDROID_KEYSTORE_STORE_PASS: ${{secrets.STOREPASS}}
Expand Down
42 changes: 20 additions & 22 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
qt_modules: qtwebengine ${{matrix.qt_modules}}
SerialPortAssistant_VERSION: v1.0.9
artifact_name: build_macos
VCPKGGITCOMMITID: 6359372f3ca1e6072e302e1d7238f31b259c5b51
VCPKGGITCOMMITID: a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6

# Map the job outputs to step outputs
outputs:
Expand Down Expand Up @@ -65,37 +65,33 @@ jobs:
key: Cache-macos-installed-qt${{matrix.qt_version}}-${{matrix.BUILD_TYPE}}

- name: run-vcpkg
uses: lukka/[email protected]
- name: run-vcpkg
uses: lukka/run-vcpkg@v11
with:
# Indicates whether to only setup vcpkg (i.e. installing it and setting the environment variables VCPKG_ROOT, RUNVCPK_VCPKG_ROOT), without installing any port.
#setupOnly: # optional
#vcpkgGitURL: https://github.com/KangLin/vcpkg.git
vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}}
vcpkgDirectory: ${{runner.workspace}}/vcpkg/
# Since the cache must be invalidated when content of the vcpkg.json file changes, let's
# compute its hash and append this to the computed cache's key.
appendedCacheKey: RabbitCommon_cache-vcpkg-msvc-vc${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.triplet}}-qt${{matrix.qt_version}}-${{matrix.BUILD_TYPE}}-${{env.VCPKGGITCOMMITID}}
#additionalCachedPaths: ${{ env.VCPKG_ROOT }}/installed
vcpkgTriplet: '${{matrix.triplet}}'
vcpkgArguments: 'openssl'

- name: run vcpkg
run: |
vcpkg install --triplet ${{matrix.triplet}}
- name: Cache Qt
if: false
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
path: ${{env.TOOSL_DIR}}/qt
key: qt${{matrix.qt_version}}_macos
key: qt${{matrix.qt_version}}-${{matrix.qt_arch}}-${{matrix.triplet}}

- name: Install Qt
# You may pin to the exact commit or the version.
# uses: jurplel/install-qt-action@a962fb91949c8e846a3e4a944d50e7ef5cc3a28a
uses: jurplel/install-qt-action@v3
with:
# Directory to install Qt
dir: ${{env.TOOSL_DIR}}/qt # optional
# Version of Qt to install
version: ${{matrix.qt_version}} # optional, default is 5.15.2
modules: ${{env.qt_modules}} # optional, see: https://ddalcino.github.io/aqt-list-server/
dir: '${{env.TOOSL_DIR}}/qt' # optional
version: '${{matrix.qt_version}}' # optional, default is 5.15.2
arch: '${{matrix.qt_arch}}' # optional
modules: '${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
cache: true
cache-key-prefix: install-qt-action

- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
Expand All @@ -106,15 +102,17 @@ jobs:
working-directory: ${{github.workspace}}/build
env:
RabbitCommon_DIR: ${{env.SOURCE_DIR}}/RabbitCommon
PKG_CONFIG_PATH: ${{env.INSTALL_DIR}}/lib/pkgconfig
run: |
cmake ${{github.workspace}} \
-DCMARK_SHARED=OFF \
-DCMARK_TESTS=OFF \
-DCMARK_STATIC=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install \
-DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}}/lib/cmake
-DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}}/lib/cmake \
-DVCPKG_VERBOSE=ON \
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON \
-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
7z a SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_macos.zip install/.
Expand Down
108 changes: 37 additions & 71 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
VCPKG_PLATFORM_TOOLSET: ${{matrix.VCPKG_PLATFORM_TOOLSET}}
CMAKE_GENERATOR_PLATFORM: ${{matrix.CMAKE_GENERATOR_PLATFORM}}
SerialPortAssistant_VERSION: v0.5.16
VCPKGGITCOMMITID: 6359372f3ca1e6072e302e1d7238f31b259c5b51
VCPKGGITCOMMITID: a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6
qt_modules: qtwebengine ${{matrix.qt_modules}}
artifact_name: build_msvc

Expand All @@ -67,91 +67,57 @@ jobs:
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOSL_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1 # not v2!
- name: Cache installed
uses: actions/cache@v3
id: cache-installed
with:
path: ${{env.TOOSL_DIR}}/qt
key: qt${{matrix.qt_version}}_${{matrix.qt_arch}}

- name: Install Qt
# You may pin to the exact commit or the version.
# uses: jurplel/install-qt-action@a962fb91949c8e846a3e4a944d50e7ef5cc3a28a
uses: jurplel/[email protected]
path: |
${{env.INSTALL_DIR}}
key: cache-installed-msvc

- name: Cache vcpkg
#if: false
uses: actions/cache@v2
id: cache-vcpkg
with:
# Directory to install Qt
dir: ${{env.TOOSL_DIR}}/qt # optional
# Version of Qt to install
version: ${{matrix.qt_version}} # optional, default is 5.15.2
# Host platform
#host: linux # optional
# Target platform for build
#target: desktop # optional, default is desktop
# Architecture for Windows/Android
arch: ${{matrix.qt_arch}} # optional
# Whether or not to install Qt dependencies on Linux
#install-deps: true # optional, default is true
# Additional Qt modules to install
modules: ${{env.qt_modules}} # optional. see: https://ddalcino.github.io/aqt-list-server/
# Force a Qt mirror in case the default is not working
#mirror: # optional
# Whether or not to actually download Qt
cached: ${{ steps.cache-qt.outputs.cache-hit }} # optional, default is false
# Whether or not to automatically run setup-python to find a valid python version.
#setup-python: false # optional, default is true
# Qt tools to download--specify comma-separated argument lists which are themselves separated by spaces: <tool_name>,<tool_version>,<tool_arch>
#tools: # optional
# Whether or not to actually install Qt or just the tools from the tools argument
#tools-only: false # optional, default is false
# Version of aqtinstall to use in case of issues
#aqtversion: # optional, default is ==0.10.0
# Version of py7zr to use in case of issues
#py7zrversion: # optional, default is ==0.11.0
# Any extra arguments to append to the back
#extra: # optional
path: |
${{ runner.workspace }}/vcpkg/
key: cache-vcpkg

- name: run-vcpkg
uses: lukka/run-vcpkg@v7.4
uses: lukka/run-vcpkg@v11
with:
# Indicates whether to only setup vcpkg (i.e. installing it and setting the environment variables VCPKG_ROOT, RUNVCPK_VCPKG_ROOT), without installing any port.
#setupOnly: # optional
#vcpkgGitURL: https://github.com/KangLin/vcpkg.git
vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}}
vcpkgDirectory: ${{runner.workspace}}/vcpkg/
# Since the cache must be invalidated when content of the vcpkg.json file changes, let's
# compute its hash and append this to the computed cache's key.
appendedCacheKey: RabbitCommon_cache-vcpkg-msvc-vc${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.triplet}}-qt${{matrix.qt_version}}-${{matrix.BUILD_TYPE}}-${{env.VCPKGGITCOMMITID}}
#additionalCachedPaths: ${{ env.VCPKG_ROOT }}/installed
vcpkgTriplet: '${{matrix.triplet}}'
vcpkgArguments: 'openssl'

- name: Cache installed
uses: actions/cache@v3
id: cache-installed
- name: run vcpkg
run: |
vcpkg install --triplet=${{matrix.triplet}}
- name: Cache Qt
if: false
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
path: |
${{env.INSTALL_DIR}}
key: msvc_cache-installed-vc${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.triplet}}-qt${{matrix.qt_version}}-${{matrix.BUILD_TYPE}}
path: ${{env.TOOSL_DIR}}/qt
key: qt${{matrix.qt_version}}_${{matrix.qt_arch}}-${{matrix.triplet}}

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
dir: '${{env.TOOSL_DIR}}/qt' # optional
version: '${{matrix.qt_version}}' # optional, default is 5.15.2
arch: '${{matrix.qt_arch}}' # optional
modules: '${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
cache: true
cache-key-prefix: install-qt-action

- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone https://github.com/KangLin/RabbitCommon.git
# - uses: ilammy/msvc-dev-cmd@v1
# with:
# arch: ${{ matrix.CMAKE_GENERATOR_PLATFORM }}
# vsversion: ${{ matrix.vc_version }}

# - name: Setup Visual Studio Tools
# uses: egor-tensin/vs-shell@v2
# with:
# arch: ${{ matrix.CMAKE_GENERATOR_PLATFORM }}

# - name: Install jom
# run: choco install jom

- name: build SerialPortAssistant
working-directory: ${{github.workspace}}/build
env:
Expand Down

0 comments on commit dd77be7

Please sign in to comment.