jurplel / install-qt-action

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

Allow splitting archives into multiple lines #195

Closed aunsbjerg closed 9 months ago

aunsbjerg commented 1 year ago

In my pipeline, I have this step:

      - name: Install Qt5 Dependencies
        uses: jurplel/install-qt-action@v3
        with:
          version: 5.15.2
          host: linux
          target: desktop
          arch: gcc_64
          modules: qtvirtualkeyboard qtwebengine
          archives: icu qtbase qtconnectivity qtdeclarative qtgraphicaleffects qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2 qtsvg qttools qttranslations qtwebchannel qtxmlpatterns

It would be lovely if the archives list could be split into multiple lines instead of having to use a single line, e.g.

archives: 
  - icu
  - qtbase
  - qtconnectivity

This would improving the diff'ng experience.

pcolby commented 10 months ago

I suspect you can achieve this already using the following YAML syntax:

archives: >-
  icu
  qtbase
  qtconnectivity

Which is exactly equivalent to:

archives: icu qtbase qtconnectivity

This should work because:

  1. the > on the archives: >- line, enables YAML's "folded" block style, so the new-lines are replaced with spaces; and
  2. the - at the end of the archives: >- line, enables YAML's "strip" block chomping, which means that the final new-line character is removed too.

So both versions above should result in the same string value: icu qtbase qtconnectivity.

You can have a play with the interactive demo at yaml-multiline.info to see how these multi-line YAML options work.

Cheers.