From 246145f5ab5648770bdcd561b7688690e4680776 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 1 Sep 2023 08:27:45 +0200 Subject: [PATCH] Add GitHub action for build and test on macOS Signed-off-by: Stefan Weil --- .github/workflows/autotools-macos.yml | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/autotools-macos.yml diff --git a/.github/workflows/autotools-macos.yml b/.github/workflows/autotools-macos.yml new file mode 100644 index 000000000..6e0c2da74 --- /dev/null +++ b/.github/workflows/autotools-macos.yml @@ -0,0 +1,59 @@ +name: autotools-macos + +# autotools build and unit tests of Leptonica on macOS Homebrew. + +on: + pull_request: + branches: [ master ] + paths: + - '**.c' + - '**.h' + - 'm4/*.m4' + - 'Makefile.am' + - 'autogen.sh' + - 'configure.ac' + + push: + + # Trigger workflow in GitHub web frontend or from API. + workflow_dispatch: + +jobs: + + brew: + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - { os: macos-12, cc: clang } + - { os: macos-13, cc: clang } + + steps: + - uses: actions/checkout@v3 + + - name: Display compiler version and latest Git history + run: | + ${{ matrix.config.cc }} --version + git log -3 --pretty=format:'%h %ad %s | %an' + + - name: Install dependencies + run: | + brew install autoconf automake gnuplot + + - name: Setup Leptonica + run: | + ./autogen.sh + + - name: Configure Leptonica + run: | + ./configure 'CC=${{ matrix.config.cc }}' + + - name: Make and install Leptonica + run: | + make + sudo make install + + - name: Make and run unit tests + run: | + make check