jurplel / install-qt-action

Install Qt on your Github Actions workflows with just one simple action
MIT License
455 stars 78 forks source link

Use tools in a matrix #177

Closed MartinDelille closed 1 year ago

MartinDelille commented 1 year ago

I'm trying to use tools in a matrix without success here: https://github.com/MartinDelille/openapi-generator/blob/f06491b24154332020ff0bc9ad78ce4eee3ac204/.github/workflows/samples-cpp-qt-client.yaml

Here is my github action:

name: Samples cpp qt client

on:
  push:
    branches:
      - 'samples/client/petstore/cpp-qt/**'
  pull_request:
    paths:
      - 'samples/client/petstore/cpp-qt/**'

env:
  GRADLE_VERSION: 6.9

jobs:
  build:
    name: Build cpp qt client
    strategy:
      matrix:
        qt-version:
          - '5.15.2'
          - '6.4.2'
        os:
          - ubuntu-latest
          - macOS-latest
          - windows-latest
        include:
          - os: windows-latest
            tools: 'tools_openssl_x64'
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v3
      - uses: jurplel/install-qt-action@v3
        with:
          version: ${{ matrix.qt-version }}
          tools: ${{ matrix.tools }}
      - name: Build
        working-directory: "samples/client/petstore/cpp-qt"
        run: cmake . && cmake --build .

The tools: ${{ matrix.tools }} doesn't seems to have any effect. Am I doing something wrong ?

ddalcino commented 1 year ago

From CI run: https://github.com/OpenAPITools/openapi-generator/actions/runs/4435878285/jobs/7783600205?pr=14968 in the "Run jurplel/install-qt-action/action@v3" step:

Arguments passed to the action:

Run jurplel/install-qt-action/action@v3
  with:
    version: 5.15.2
    target: desktop
    install-deps: true
    cache: false
    cache-key-prefix: install-qt-action
    tools: tools_openssl_x64
    set-env: true
    tools-only: false
    aqtversion: ==2.1.*
    py7zrversion: ==0.19.*

Relevant output for the install-tool part: https://github.com/OpenAPITools/openapi-generator/actions/runs/4435878285/jobs/7783600205?pr=14968#step:3:212

C:\hostedtoolcache\windows\Python\3.11.2\x64\python.exe -m aqt install-tool windows desktop tools_openssl_x64 --outputdir D:\a\openapi-generator/Qt
aqtinstall(aqt) v2.1.0 on Python 3.11.2 [CPython MSC v.1934 64 bit (AMD64)]
Downloading qt.tools.openssl.win_x64...
Redirected: qt.mirror.constant.com
Finished installation of openssl_1.1.1q_prebuild_x64.7z in 4.58491100
Finished installation
Time elapsed: 8.53421840 second

To me, it definitely looks like tools: ${{ matrix.tools }} had an effect. If you look, you will see a bunch of .dlls, .pdbs, and an openssl.exe at D:\a\openapi-generator\Qt\Tools\OpenSSL\Win_x64\bin.

If something has gone wrong in your CI run, I don't see what it has to do with install-qt-action.

MartinDelille commented 1 year ago

Indeed. The issue came from the CMakeLists.txt so I fixed it.