QCAD自动化编译测试

使用GitHub Actions 自动化编译QCAD

编写自动化编译流水线文件Windows.yaml

# This is a basic workflow to help you get started with Actions

name: Windows

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  push:
    branches: [ master ]
     # 忽略README.md
    paths-ignore:
      - 'README.md'
      - 'LICENSE'
  pull_request:
    branches: [ master ]
    # 忽略README.md
    paths-ignore:
      - 'README.md'
      - 'LICENSE'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    name: Build
    # The type of runner that the job will run on
    runs-on: windows-latest
    strategy:
      matrix:
          qt_ver: [5.14.0]
          qt_target: [desktop]
          qt_arch: [win64_msvc2017_64]
          include:
            - qt_arch: win64_msvc2017_64
              msvc_arch: x64
    env:
      targetName: qcad.exe
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - name: cacheQt
        id: WindowsCacheQt
        uses: actions/cache@v1
        with:
          path: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch_install}}
          key: ${{ runner.os }}-Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}

      - name: Install Qt
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
        uses: jurplel/install-qt-action@v2
        with:
          # Version of Qt to install
          version: ${{ matrix.qt_ver }}
          # Target platform for build
          target: ${{ matrix.qt_target }}
          # Architecture for Windows/Android
          arch: ${{ matrix.qt_arch }}
          install-deps: 'true'
          modules: 'qtwebengine qtscript'
          cached: ${{steps.WindowsCacheQt.outputs.cache-hit }}

      - uses: actions/checkout@v1
        with:
          fetch-depth: 1
          
      - name: build-msvc
        shell: cmd
        env:
          vc_arch: ${{ matrix.msvc_arch }}
          qt_ver:  ${{ matrix.qt_ver }} 
        run: |
          call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" %vc_arch%
          qmake -r CONFIG+=ractivated 
          nmake
          cd src\\3rdparty\\qt-labs-qtscriptgenerator-%qt_ver%
          qmake -r CONFIG+=ractivated
          nmake 

编译测试

经过测试编译过程大概需要1h。
在这里插入图片描述

参考

Qt使用github-Actions自动化编译

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容