Skip to content
24 changes: 24 additions & 0 deletions .github/workflows/validate-travis.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions scripts/validate-travis-macos.sh
Original file line number Diff line number Diff line change
@@ -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."