summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2020-11-22 00:41:38 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2020-11-22 00:41:38 (GMT)
commit5cdbf004f4bdff1275fd3c1a8300c91d4f68f58c (patch)
treed68e9a2f48b457a23817e41a31acaa3e9fea8828
parentcb3e95828c6ea557c9786218199b5e97e935470e (diff)
parentcc103187fd9e876ecb4a6fcf4455d18454913768 (diff)
downloadtk-5cdbf004f4bdff1275fd3c1a8300c91d4f68f58c.zip
tk-5cdbf004f4bdff1275fd3c1a8300c91d4f68f58c.tar.gz
tk-5cdbf004f4bdff1275fd3c1a8300c91d4f68f58c.tar.bz2
Add building on macOS
-rw-r--r--.github/workflows/mac-build.yml164
1 files changed, 164 insertions, 0 deletions
diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml
new file mode 100644
index 0000000..2760be9
--- /dev/null
+++ b/.github/workflows/mac-build.yml
@@ -0,0 +1,164 @@
+name: macOS
+on: [push]
+env:
+ ERROR_ON_FAILURES: 1
+jobs:
+ with-Xcode:
+ runs-on: macos-latest
+ defaults:
+ run:
+ shell: bash
+ working-directory: tk/macosx
+ steps:
+ - name: Check out Tk
+ uses: actions/checkout@v2
+ with:
+ path: tk
+ - name: Check out Tcl
+ uses: actions/checkout@v2
+ with:
+ repository: tcltk/tcl
+ ref: core-8-branch
+ path: tcl
+ - name: Prepare checked out repositories
+ run: |
+ touch tk/generic/tkStubInit.c
+ mkdir build
+ echo "BUILD_DIR=`cd build && pwd`" >> $GITHUB_ENV
+ echo "DESTDIR=`cd build && pwd`" >> $GITHUB_ENV
+ working-directory: .
+ - name: Build Tcl
+ run: |
+ make all
+ working-directory: tcl/macosx
+ - name: Build
+ run: |
+ make all install || {
+ echo "::error::Failure during Build"
+ exit 1
+ }
+ - name: Run Tests
+ run: |
+ make test styles=develop | tee out-tests.txt || {
+ echo "::error::Failure during Test"
+ exit 1
+ }
+ cat out-tests.txt | grep -q "Failed[[:space:]][[:space:]]*[1-9]" && {
+ echo "::error::Failure during Test"
+ exit 1
+ }
+ env:
+ MAC_CI: 1
+ Unix-like:
+ runs-on: macos-latest
+ strategy:
+ matrix:
+ symbols:
+ - 'no'
+ - 'mem'
+ options:
+ - '--enable-aqua'
+ - '--disable-aqua'
+ defaults:
+ run:
+ shell: bash
+ working-directory: tk/unix
+ steps:
+ - name: Check out Tk
+ uses: actions/checkout@v2
+ with:
+ path: tk
+ - name: Check out Tcl
+ uses: actions/checkout@v2
+ with:
+ repository: tcltk/tcl
+ ref: core-8-branch
+ path: tcl
+ - name: Prepare checked out repositories
+ run: |
+ touch tkStubInit.c
+ mkdir "$HOME/install dir"
+ echo "USE_XVFB=$SET_DISPLAY" >> $GITHUB_ENV
+ working-directory: tk/generic
+ env:
+ SET_DISPLAY: ${{ contains(matrix.options, '--disable-aqua') }}
+ - name: Add X11 (if required)
+ if: ${{ env.USE_XVFB }}
+ # This involves black magic
+ run: |
+ brew cask install xquartz
+ sudo /opt/X11/lib/X11/xinit/privileged_startx.d/10-tmpdirs || true
+ working-directory: .
+ - name: Build Tcl
+ # Note that macOS is always a 64 bit platform
+ run: |
+ ./configure --enable-64bit ${CFGOPT} "--prefix=$HOME/install dir" || {
+ cat config.log
+ echo "::error::Failure during Tcl Configure"
+ exit 1
+ }
+ make all || {
+ echo "::error::Failure during Tcl Build"
+ exit 1
+ }
+ make install || {
+ echo "::error::Failure during Tcl Install"
+ exit 1
+ }
+ working-directory: tcl/unix
+ env:
+ CFGOPT: --enable-symbols=${{ matrix.symbols }}
+ - name: Configure (symbols=${{ matrix.symbols }} ${{matrix.options }})
+ # Note that macOS is always a 64 bit platform
+ run: |
+ ./configure --enable-64bit ${CFGOPT} "--prefix=$HOME/install dir" || {
+ cat config.log
+ echo "::error::Failure during Configure"
+ exit 1
+ }
+ env:
+ CFGOPT: --enable-symbols=${{ matrix.symbols }} ${{matrix.options }}
+ - name: Build
+ run: |
+ make all tktest || {
+ echo "::error::Failure during Build"
+ exit 1
+ }
+ - name: Run Tests
+ run: |
+ if [ $USE_XVFB == true ]; then
+ function runXvfb {
+ PATH=$PATH:/opt/X11/bin
+ Xvfb $1 &
+ XVFB_PID=$!
+ echo Launched Xvfb $1 as process $XVFB_PID >&2
+ trap "echo killing process $XVFB_PID... >&2; kill $XVFB_PID" 0
+ export DISPLAY=$1
+ sleep 2
+ }
+ else
+ function runXvfb {
+ : do nothing
+ }
+ fi
+ ( runXvfb :0; make test-classic; exit $? ) | tee out-classic.txt || {
+ echo "::error::Failure during Test"
+ exit 1
+ }
+ ( runXvfb :0; make test-ttk; exit $? ) | tee out-ttk.txt || {
+ echo "::error::Failure during Test"
+ exit 1
+ }
+ cat out-classic.txt out-ttk.txt | grep -q "Failed[[:space:]][[:space:]]*[1-9]" && {
+ echo "::error::Failure during Test"
+ exit 1
+ }
+ env:
+ MAC_CI: 1
+ - name: Carry out trial installation
+ run: |
+ make install || {
+ cat config.log
+ echo "::error::Failure during Install"
+ exit 1
+ }