Merge pull request #10 from JesseGuoX/main

update workflow, speed up ci
main
zhuzichu 2023-04-03 08:41:22 +08:00 committed by GitHub
commit a9c97a5c56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 11 deletions

View File

@ -16,24 +16,23 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [macos-11.0] os: [macos-12]
qt_ver: [6.4.3] qt_ver: [6.4.3]
qt_arch: [clang_64] qt_arch: [clang_64]
env: env:
targetName: example targetName: example
steps: steps:
# macos 11.0 默认环境变了,要指定 - name: '⚙️ Cache Qt'
- name: prepare env id: cache-qt
if: ${{ matrix.os == 'macos-11.0' }} uses: actions/cache@v3
run: | with:
softwareupdate --all --install --force path: ${{ runner.workspace }}/Qt
sudo xcode-select --print-path key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
sudo xcode-select --switch /Library/Developer/CommandLineTools
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v3 uses: jurplel/install-qt-action@v3
with: with:
version: ${{ matrix.qt_ver }} version: ${{ matrix.qt_ver }}
cached: 'false' cache: ${{steps.cache-qt.outputs.cache-hit}}
arch: ${{ matrix.qt_arch }} arch: ${{ matrix.qt_arch }}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats' modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -24,11 +24,17 @@ jobs:
env: env:
targetName: example targetName: example
steps: steps:
- name: '⚙️ Cache Qt'
id: cache-qt
uses: actions/cache@v3
with:
path: ${{ runner.workspace }}/Qt
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v3 uses: jurplel/install-qt-action@v3
with: with:
version: ${{ matrix.qt_ver }} version: ${{ matrix.qt_ver }}
cached: 'false' cache: ${{steps.cache-qt.outputs.cache-hit}}
arch: ${{ matrix.qt_arch }} arch: ${{ matrix.qt_arch }}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats' modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- name: ubuntu install GL library - name: ubuntu install GL library
@ -44,6 +50,8 @@ jobs:
uses: miurahr/install-linuxdeploy-action@v1 uses: miurahr/install-linuxdeploy-action@v1
with: with:
plugins: qt appimage plugins: qt appimage
- name: Check if svg file exists
run: if [ ! -f "${targetName}.svg" ]; then echo "File not found, creating..."; touch ${targetName}.svg; fi
# 打包 # 打包
- name: package - name: package
run: | run: |

View File

@ -30,6 +30,12 @@ jobs:
fileName: example fileName: example
# 步骤 # 步骤
steps: steps:
- name: '⚙️ Cache Qt'
id: cache-qt
uses: actions/cache@v3
with:
path: ${{ runner.workspace }}\Qt
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
# 安装Qt # 安装Qt
- name: Install Qt - name: Install Qt
# 使用外部action。这个action专门用来安装Qt # 使用外部action。这个action专门用来安装Qt
@ -37,7 +43,7 @@ jobs:
with: with:
version: ${{ matrix.qt_ver }} version: ${{ matrix.qt_ver }}
arch: ${{ matrix.qt_arch }} arch: ${{ matrix.qt_arch }}
cached: 'false' cache: ${{steps.cache-qt.outputs.cache-hit}}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats' modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
# 拉取代码 # 拉取代码
- uses: actions/checkout@v2 - uses: actions/checkout@v2