build.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: Build
  2. on:
  3. push:
  4. branches-ignore:
  5. - "releases/**"
  6. paths-ignore:
  7. - "**.md"
  8. pull_request:
  9. paths-ignore:
  10. - "**.md"
  11. jobs:
  12. build:
  13. strategy:
  14. matrix:
  15. qt_version: [5.12.11, 5.15.2, 6.2.0]
  16. platform: [ubuntu-20.04, windows-latest, macos-latest]
  17. include:
  18. - qt_version: 6.2.0
  19. additional_arguments: -D QT_DEFAULT_MAJOR_VERSION=6
  20. - platform: ubuntu-20.04
  21. make: make
  22. CXXFLAGS: -Wall -Wextra -pedantic -Werror
  23. MAKEFLAGS: -j2
  24. - platform: macos-latest
  25. make: make
  26. CXXFLAGS: -Wall -Wextra -pedantic -Werror -Wno-gnu-zero-variadic-macro-arguments # Ignore false-positive warning for qCWarning
  27. MAKEFLAGS: -j3
  28. - platform: windows-latest
  29. make: nmake
  30. CXXFLAGS: /W4 /WX /MP
  31. runs-on: ${{ matrix.platform }}
  32. env:
  33. CXXFLAGS: ${{ matrix.CXXFLAGS }}
  34. MAKEFLAGS: ${{ matrix.MAKEFLAGS }}
  35. steps:
  36. - name: Clone repo
  37. uses: actions/checkout@v2.3.4
  38. - name: Install Qt
  39. uses: jurplel/install-qt-action@v2.14.0
  40. with:
  41. version: ${{ matrix.qt_version }}
  42. - name: Build with CMake as static
  43. run: |
  44. cmake . -D QHOTKEY_EXAMPLES=ON ${{ matrix.additional_arguments }}
  45. cmake --build .
  46. - name: Build with CMake as shared
  47. run: |
  48. cmake . -D BUILD_SHARED_LIBS=ON -D QHOTKEY_EXAMPLES=ON ${{ matrix.additional_arguments }}
  49. cmake --build .
  50. - name: Setup MSVC environment for QMake
  51. uses: ilammy/msvc-dev-cmd@v1
  52. - name: Build with QMake as static
  53. working-directory: HotkeyTest
  54. run: |
  55. qmake
  56. ${{ matrix.make }}
  57. - name: Build with QMake as shared
  58. working-directory: HotkeyTest
  59. run: |
  60. qmake "DEFINES+=QHOTKEY_SHARED QHOTKEY_LIBRARY"
  61. ${{ matrix.make }}