Skip to content

Mingw

Mingw #143

Workflow file for this run

name: Mingw
on:
workflow_dispatch:
inputs:
tcl-tags: # User input for selecting Tcl tag
description: 'Tcl version'
required: true
type: choice
options:
- '["core-9-0-0"]'
- '["core-8-6-13"]'
- '["main"]'
- '["core-8-6-branch"]'
- '["core-8-6-13", "core-9-0-0"]'
- '["core-8-6-13", "core-9-0-0", "main", "core-8-6-branch"]'
default: '["core-8-6-13", "core-9-0-0"]'
runners: # User input for selecting OS
description: 'OS version'
required: true
type: choice
options:
- '["windows-latest"]'
- '["windows-2022"]'
- '["windows-2019"]'
- '["windows-2019", "windows-2022"]'
default: '["windows-latest"]'
msystems:
description: 'mingw32 and/or mingw64'
required: false
type: choice
options:
- '["mingw64"]'
- '["mingw32"]'
- '["mingw64", "mingw32"]'
default: '["mingw64", "mingw32"]'
run-tests: # Whether tests should be run
description: 'Run tests as well'
required: false
default: true
type: boolean
with-dyncall: # Build with dyncall
description: 'Build dyncall version'
required: false
default: true
type: boolean
with-libffi: # Build with libffi
description: 'Build libffi version'
required: false
default: true
type: boolean
jobs:
build:
strategy:
matrix:
runner-os: ${{ fromJSON(github.event.inputs.runners) }}
tcl-tag: ${{ fromJSON(github.event.inputs.tcl-tags) }}
msystem: ${{ fromJSON(github.event.inputs.msystems) }}
runs-on: ${{ matrix.runner-os }}
defaults:
run:
shell: msys2 {0}
steps:
- name: Set up msys2 for mingw32
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
pacboy: "git: make: gcc:p"
path-type: minimal
release: true
update: false
cache: true
- name: Verify toolchain
run: |
gcc -v
make -v
- name: Setup Tcl
id: tcl-setup-step
uses: apnadkarni/tcl-setup@v1
with:
tcl-tag: ${{ matrix.tcl-tag }}
toolchain: 'msys2'
target-arch: ${{ matrix.msystem }}
- name: Install libffi
if: inputs.with-libffi
run: |
pacman --sync --refresh --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-libffi
- name: Install dyncall
if: inputs.with-dyncall
run: |
wget https://dyncall.org/r1.4/dyncall-1.4.tar.gz
tar xf dyncall-1.4.tar.gz
cd dyncall-1.4
mkdir build
cd build
../configure --prefix=${{ env.TCLEXTRASDIR }}
make
make install
- name: Build with libffi extension
if: inputs.with-libffi
uses: apnadkarni/tcl-build-extension@v1
with:
toolchain: 'msys2'
build-subdir: 'build-with-libffi'
run-tests: ${{ inputs.run-tests }}
- name: Build with dyncall extension
if: inputs.with-dyncall
uses: apnadkarni/tcl-build-extension@v1
with:
toolchain: 'msys2'
build-subdir: 'build-with-dyncall'
run-tests: ${{ inputs.run-tests }}
config-opts: 'LDFLAGS=-L${{ env.TCLEXTRASDIR }}/lib CPPFLAGS=-I${{ env.TCLEXTRASDIR }}/include --with-dyncall'