|
| 1 | +name: build |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +permissions: |
| 6 | + contents: read |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: windows-latest |
| 11 | + |
| 12 | + steps: |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: setup-msys2 |
| 17 | + uses: msys2/setup-msys2@v2 |
| 18 | + with: |
| 19 | + msystem: MSYS |
| 20 | + update: true |
| 21 | + install: msys2-devel base-devel autotools cocom diffutils gcc gettext-devel libiconv-devel make mingw-w64-cross-crt mingw-w64-cross-gcc mingw-w64-cross-zlib perl zlib-devel xmlto docbook-xsl |
| 22 | + |
| 23 | + - name: Build |
| 24 | + shell: msys2 {0} |
| 25 | + run: | |
| 26 | + (cd winsup && ./autogen.sh) |
| 27 | + ./configure --disable-dependency-tracking --with-msys2-runtime-commit="$GITHUB_SHA" |
| 28 | + make -j8 |
| 29 | +
|
| 30 | + - name: Install |
| 31 | + shell: msys2 {0} |
| 32 | + run: | |
| 33 | + make DESTDIR="$(pwd)"/_dest install |
| 34 | +
|
| 35 | + - name: Upload |
| 36 | + uses: actions/upload-artifact@v4 |
| 37 | + with: |
| 38 | + name: install |
| 39 | + path: _dest/ |
| 40 | + |
| 41 | + generate-msys2-tests-matrix: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + outputs: |
| 44 | + matrix: ${{ steps.matrix.outputs.matrix }} |
| 45 | + steps: |
| 46 | + - id: matrix |
| 47 | + uses: msys2/msys2-tests/gha-matrix-gen@main |
| 48 | + |
| 49 | + msys2-tests: |
| 50 | + needs: [build, generate-msys2-tests-matrix] |
| 51 | + strategy: |
| 52 | + fail-fast: false |
| 53 | + matrix: |
| 54 | + include: ${{ fromJson(needs.generate-msys2-tests-matrix.outputs.matrix) }} |
| 55 | + |
| 56 | + name: msys2-tests ${{ matrix.msystem }}-${{ matrix.cc }} |
| 57 | + runs-on: ${{ matrix.runner }} |
| 58 | + env: |
| 59 | + CC: ${{ matrix.cc }} |
| 60 | + CXX: ${{ matrix.cxx }} |
| 61 | + FC: ${{ matrix.fc }} |
| 62 | + steps: |
| 63 | + - id: msys2 |
| 64 | + uses: msys2/setup-msys2@v2 |
| 65 | + with: |
| 66 | + msystem: ${{ matrix.msystem }} |
| 67 | + update: true |
| 68 | + install: ${{ matrix.packages }} |
| 69 | + |
| 70 | + - name: Add staging repo |
| 71 | + shell: msys2 {0} |
| 72 | + run: | |
| 73 | + sed -i '1s|^|[staging]\nServer = https://repo.msys2.org/staging/\nSigLevel = Never\n|' /etc/pacman.conf |
| 74 | +
|
| 75 | + - name: Update using staging |
| 76 | + shell: pwsh |
| 77 | + run: | |
| 78 | + msys2 -c 'pacman --noconfirm -Suuy' |
| 79 | + $ErrorActionPreference = 'Stop' |
| 80 | + $PSNativeCommandUseErrorActionPreference = $true |
| 81 | + msys2 -c 'pacman --noconfirm -Suu' |
| 82 | +
|
| 83 | + - name: Download msys2-runtime artifact |
| 84 | + uses: actions/download-artifact@v4 |
| 85 | + with: |
| 86 | + name: install |
| 87 | + path: ${{ steps.msys2.outputs.msys2-location }} |
| 88 | + |
| 89 | + - name: uname -a |
| 90 | + shell: msys2 {0} |
| 91 | + run: uname -a |
| 92 | + |
| 93 | + - name: Run tests |
| 94 | + uses: msys2/msys2-tests@main |
| 95 | + |
0 commit comments