diff --git a/.github/workflows/validate-travis.yml b/.github/workflows/validate-travis.yml new file mode 100644 index 00000000..38b60520 --- /dev/null +++ b/.github/workflows/validate-travis.yml @@ -0,0 +1,24 @@ +name: Validate Travis config + +on: + workflow_dispatch: + pull_request: + paths: + - '.travis.yml' + - '.github/workflows/validate-travis.yml' + - 'scripts/validate-travis-macos.sh' + push: + branches: + - '**' + paths: + - '.travis.yml' + - '.github/workflows/validate-travis.yml' + - 'scripts/validate-travis-macos.sh' + +jobs: + yaml: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Validate macOS Travis fix (issue #35) + run: ./scripts/validate-travis-macos.sh diff --git a/.travis.yml b/.travis.yml index 9e39083a..87e51518 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,12 +50,11 @@ matrix: # OSX ############################################################################ - # FIXME: Error exit code when installing OpenCV with Brew - # OSX build - #- os: osx - #compiler: clang - #env: - #- ENV_CXX_FLAGS="-Wno-c99-extensions" + # OSX build (Java/Maven only; skip Linux OpenCL Homebrew bootstrap) + - os: osx + compiler: clang + env: + - ENV_CXX_FLAGS="-Wno-c99-extensions" ############################################################################ # POCL builds (OpenCL 1.0, 1.1) @@ -239,10 +238,10 @@ before_install: #sudo apt-get install -qq -y clang-3.7 libclang-common-3.7-dev libclang-3.7-dev libclang1-3.7 libllvm3.7 lldb-3.7 llvm-3.7 llvm-3.7-dev llvm-3.7-runtime clang-modernize-3.7 clang-format-3.7 lldb-3.7-dev # OSX elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then + # Keep lightweight Homebrew deps; skip OpenCV (exit 1) that disabled this job. brew update brew outdated boost || brew upgrade boost brew outdated cmake || brew upgrade cmake - brew install lcov opencv # FIXME: exit status 1 with no error message fi - gem install coveralls-lcov - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi diff --git a/scripts/validate-travis-macos.sh b/scripts/validate-travis-macos.sh new file mode 100755 index 00000000..09540cc3 --- /dev/null +++ b/scripts/validate-travis-macos.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# Validates .travis.yml for the macOS matrix fix (issue #35). +# Run from repo root: ./scripts/validate-travis-macos.sh +set -euo pipefail + +root="$(cd "$(dirname "$0")/.." && pwd)" +cd "$root" + +echo "==> YAML parse" +ruby -e 'require "yaml"; YAML.load_file(".travis.yml"); puts "yaml ok"' + +echo "==> macOS matrix entry enabled" +grep -q '^[[:space:]]*- os: osx' .travis.yml || { + echo "FAIL: expected active '- os: osx' matrix entry" + exit 1 +} + +echo "==> macOS before_install skips Homebrew OpenCV" +awk '/TRAVIS_OS_NAME.*osx/,/fi/ {print}' .travis.yml | grep -q 'brew install.*opencv' && { + echo "FAIL: macOS block still runs 'brew install ... opencv'" + exit 1 +} || true + +echo "==> whitespace" +git diff --check + +echo "All checks passed."