msys2.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. name: msys2
  2. concurrency:
  3. group: msys2-${{ github.head_ref || github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. push:
  7. paths:
  8. - "mesonbuild/**"
  9. - "test cases/**"
  10. - "unittests/**"
  11. - ".github/workflows/msys2.yml"
  12. - "run_unittests.py"
  13. pull_request:
  14. paths:
  15. - "mesonbuild/**"
  16. - "test cases/**"
  17. - "unittests/**"
  18. - ".github/workflows/msys2.yml"
  19. - "run_unittests.py"
  20. permissions:
  21. contents: read
  22. jobs:
  23. test:
  24. runs-on: windows-2019
  25. name: ${{ matrix.NAME }}
  26. strategy:
  27. fail-fast: false
  28. matrix:
  29. include:
  30. - NAME: gccx86ninja
  31. MSYSTEM: MINGW32
  32. MSYS2_ARCH: i686
  33. MSYS2_CURSES: ncurses
  34. COMPILER: gcc
  35. TOOLCHAIN: toolchain
  36. - NAME: gccx64ninja
  37. MSYSTEM: MINGW64
  38. MSYS2_ARCH: x86_64
  39. MSYS2_CURSES: pdcurses
  40. COMPILER: gcc
  41. TOOLCHAIN: toolchain
  42. - NAME: clangx64ninja
  43. MSYSTEM: MINGW64
  44. MSYS2_ARCH: x86_64
  45. MSYS2_CURSES:
  46. COMPILER: clang
  47. TOOLCHAIN: clang
  48. env:
  49. MESON_CI_JOBNAME: msys2-${{ matrix.NAME }}
  50. # XXX: For some reason enabling jit debugging "fixes" random python crashes
  51. # see https://github.com/msys2/MINGW-packages/issues/11864
  52. MSYS: "winjitdebug"
  53. defaults:
  54. run:
  55. shell: msys2 {0}
  56. steps:
  57. - uses: actions/checkout@v3
  58. - uses: msys2/setup-msys2@v2
  59. with:
  60. msystem: ${{ matrix.MSYSTEM }}
  61. update: true
  62. install: >-
  63. base-devel
  64. git
  65. mercurial
  66. lcov
  67. wget
  68. unzip
  69. mingw-w64-${{ matrix.MSYS2_ARCH }}-cmake
  70. mingw-w64-${{ matrix.MSYS2_ARCH }}-glib2
  71. mingw-w64-${{ matrix.MSYS2_ARCH }}-libxml2
  72. mingw-w64-${{ matrix.MSYS2_ARCH }}-ninja
  73. mingw-w64-${{ matrix.MSYS2_ARCH }}-pkg-config
  74. mingw-w64-${{ matrix.MSYS2_ARCH }}-python2
  75. mingw-w64-${{ matrix.MSYS2_ARCH }}-python
  76. mingw-w64-${{ matrix.MSYS2_ARCH }}-python-lxml
  77. mingw-w64-${{ matrix.MSYS2_ARCH }}-python-setuptools
  78. mingw-w64-${{ matrix.MSYS2_ARCH }}-python-pip
  79. mingw-w64-${{ matrix.MSYS2_ARCH }}-${{ matrix.TOOLCHAIN }}
  80. - name: Install dependencies
  81. run: |
  82. python3 -m pip --disable-pip-version-check install gcovr jsonschema pefile pytest pytest-subtests pytest-xdist coverage codecov
  83. - name: Install pypy3 on x86_64
  84. run: |
  85. mkdir pypy3local
  86. pushd pypy3local
  87. wget -nv https://downloads.python.org/pypy/pypy3.8-v7.3.9-win64.zip
  88. unzip pypy3.8-v7.3.9-win64.zip
  89. mv pypy3.8-v7.3.9-win64/* ./
  90. popd
  91. if: ${{ matrix.MSYS2_ARCH == 'x86_64' }}
  92. - name: Run Tests
  93. run: |
  94. if [[ "${{ matrix.MSYS2_ARCH }}" == "x86_64" ]]; then
  95. # There apparently is no clean way to add to the PATH in the
  96. # previous step?
  97. # See for instance https://github.com/msys2/setup-msys2/issues/171
  98. export PATH=$PATH:$PWD/pypy3local
  99. # Make sure it is on the PATH
  100. pypy3 -c "import sys; print(sys.version)"
  101. fi
  102. export PATHEXT="$PATHEXT;.py"
  103. if [[ '${{ matrix.COMPILER }}' == 'clang' ]]; then
  104. export CC=clang
  105. export CXX=clang++
  106. export OBJC=clang
  107. export OBJCXX=clang++
  108. fi
  109. if [[ "${{ matrix.MSYS2_CURSES }}" != "" ]]; then
  110. pacman --noconfirm --needed -S mingw-w64-${{ matrix.MSYS2_ARCH }}-${{ matrix.MSYS2_CURSES }}
  111. fi
  112. MSYSTEM= python3 ./tools/run_with_cov.py run_tests.py --backend=ninja
  113. - uses: actions/upload-artifact@v3
  114. with:
  115. name: ${{ matrix.NAME }}
  116. path: meson-test-run.*
  117. - name: Upload coverage report
  118. run: ./ci/upload_cov.sh "${{ matrix.NAME }}"