name: Mac CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: macos-latest

    steps:
    - uses: actions/checkout@v2
    - name: Build dependencies
      # Building tcl to make sure we get tclInt.h
      run: |
        sudo mkdir -p /usr/local/src/git
        sudo chown `id -un` /usr/local/src/git
        cd /usr/local/src/git
        git clone https://github.com/tcltk/tcl.git
        cd tcl
        git checkout core-8-6-branch
        cd unix
        ./configure
        make
        sudo make install
    - name: configure
      run: |
        autoreconf -vi
        ./configure --with-tcl=/usr/local/lib --prefix=/usr/local
    - name: make
      run: make
    - name: test
      # These tests fail on Mac *only* in the Github Actions containers, and this
      # cannot be reproduced in a workable test environment. It may be related to
      # the general signal handling issues with multithreaded TclX. Try re-enabling
      # when on Tcl(x) 8.7 where the problem should be fixed.
      continue-on-error: true
      run: SKIPFILES="pipe.test process.test signal.test" make test
    - name: install
      run: sudo make install

