Skip to content

Commit

Permalink
CI: modify cache
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Jan 10, 2024
1 parent 7ed8815 commit d8b92cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 54 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
STOREPASS: ${{secrets.STOREPASS}}
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_${{matrix.BUILD_TYPE}}
INSTALL_DIR: ${{github.workspace}}/.cache/install
RabbitCommon_VERSION: v0.0.25
VCPKGGITCOMMITID: f1c6efee2245009540dde947e0e3d008f3aa7dbb
ANDROID_PLATFORM: android-28
Expand Down Expand Up @@ -66,14 +66,6 @@ jobs:
${{env.INSTALL_DIR}}
key: cache-installed-android-qt${{matrix.qt_version}}-${{matrix.VCPKG_TARGET_TRIPLET}}-${{matrix.BUILD_TYPE}}

- 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}}_${{matrix.qt_arch}}

- name: Install Qt of gcc_64
uses: jurplel/install-qt-action@v3
with:
Expand All @@ -83,7 +75,8 @@ jobs:
target: 'desktop'
arch: 'gcc_64'
set-env: false
cached: '${{ steps.cache-qt.outputs.cache-hit }}' # optional, default is false
cache: true
cache-key-prefix: cached_qt

- name: Install Qt of android
uses: jurplel/install-qt-action@v3
Expand All @@ -101,7 +94,8 @@ jobs:
# Additional Qt modules to install
modules: '${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
# Whether or not to actually download Qt
cached: '${{ steps.cache-qt.outputs.cache-hit }}' # optional, default is false
cache: true
cache-key-prefix: cached_qt

- name: run-vcpkg
if: false
Expand All @@ -112,12 +106,6 @@ jobs:
#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: build RabbitCommon
working-directory: ${{github.workspace}}/build
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_macos
INSTALL_DIR: ${{github.workspace}}/.cache/install
qt_modules: ${{matrix.qt_modules}}
VCPKGGITCOMMITID: f1c6efee2245009540dde947e0e3d008f3aa7dbb
RabbitCommon_VERSION: v1.0.13
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
with:
path: |
${{env.INSTALL_DIR}}
key: Cache-macos-installed-qt${{matrix.qt_version}}-${{matrix.BUILD_TYPE}}
key: cached-macos-install-qt${{matrix.qt_version}}-${{matrix.qt_arch}}-${{matrix.BUILD_TYPE}}

- name: run-vcpkg
uses: lukka/run-vcpkg@v11
Expand All @@ -76,19 +76,6 @@ jobs:
#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: 'zlib openssl'

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

- name: Install Qt
# You may pin to the exact commit or the version.
Expand All @@ -100,7 +87,8 @@ jobs:
# 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/
cache: ${{steps.cache-qt.outputs.cache-hit}} # optional, default is false
cache: true
cache-key-prefix: cached_qt

- name: Compile use cmake
working-directory: ${{github.workspace}}/build
Expand Down
25 changes: 4 additions & 21 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
env:
SOURCE_DIR: ${{github.workspace}}\.cache\source
TOOSL_DIR: ${{github.workspace}}\.cache\tools
INSTALL_DIR: ${{github.workspace}}\.cache\install_msvc_${{matrix.triplet}}_${{matrix.BUILD_TYPE}}
INSTALL_DIR: ${{github.workspace}}\.cache\install
CMAKE_GENERATOR: "Visual Studio 17 2022"
VCPKG_PLATFORM_TOOLSET: ${{matrix.VCPKG_PLATFORM_TOOLSET}}
CMAKE_GENERATOR_PLATFORM: ${{matrix.CMAKE_GENERATOR_PLATFORM}}
Expand Down Expand Up @@ -100,19 +100,8 @@ jobs:
# Force a Qt mirror in case the default is not working
#mirror: # optional
# Whether or not to actually download Qt
cache: ${{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
cache: true
cache-key-prefix: cached_qt

- name: run-vcpkg
uses: lukka/run-vcpkg@v11
Expand All @@ -122,20 +111,14 @@ jobs:
#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: 'zlib openssl'

- name: Cache installed
uses: actions/cache@v3
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: msvc_cache-installed-qt${{matrix.qt_version}}-${{matrix.BUILD_TYPE}}
key: cache-install-qt${{matrix.qt_version}}_${{matrix.triplet}}_${{matrix.BUILD_TYPE}}

- name: build log4qt
if: false
Expand Down

0 comments on commit d8b92cb

Please sign in to comment.