From 6e9bad30a0d6cb5b1113605867cc066783b0a1ec Mon Sep 17 00:00:00 2001 From: leso-kn Date: Wed, 8 Nov 2023 20:37:43 +0100 Subject: [PATCH] ci: Add mingw build --- .github/workflows/build.yml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7d0e3c5..0ef168fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,21 +10,42 @@ jobs: strategy: fail-fast: false matrix: - luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ] - platform: [ "ubuntu-22.04", "macos-11", "windows-2022" ] - runs-on: ${{ matrix.platform }} + luaVersion: + - v: "5.4" + s: 54 + - v: "5.3" + s: 53 + - v: "5.2" + s: 52 + - v: "5.1" + s: 51 + - v: "luajit" + s: jit + - v: "luajit-openresty" + platform: [ "ubuntu-22.04", "macos-11", "windows-2022", "mingw" ] + runs-on: ${{ matrix.platform == 'mingw' && 'windows-2022' || matrix.platform }} steps: - name: Checkout uses: actions/checkout@v4 - name: Setup ’msvc’ - if: ${{ startsWith(matrix.platform, 'windows') && !startsWith(matrix.luaVersion, 'luajit') }} + if: ${{ startsWith(matrix.platform, 'windows') && !startsWith(matrix.luaVersion.v, 'luajit') }} uses: ilammy/msvc-dev-cmd@v1 + - name: Setup ’msys2’ + uses: msys2/setup-msys2@v2 + if: ${{ matrix.platform == 'mingw' }} + with: + install: >- + mingw-w64-x86_64-gcc + mingw-w64-x86_64-lua${{ matrix.luaVersion.s }} + mingw-w64-x86_64-luarocks - name: Setup ‘lua’ uses: leso-kn/gh-actions-lua@v11-staging + if: ${{ matrix.platform != 'mingw' }} with: - luaVersion: ${{ matrix.luaVersion }} + luaVersion: ${{ matrix.luaVersion.v }} - name: Setup ‘luarocks’ uses: hishamhm/gh-actions-luarocks@master + if: ${{ matrix.platform != 'mingw' }} - name: Make and install run: | luarocks make -- luasocket-scm-3.rockspec