Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/validate-travis-run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Validate Travis RUN_TESTS

on:
pull_request:
paths:
- '.travis.yml'
- '.github/workflows/validate-travis-run-tests.yml'
- 'scripts/validate-travis-run-tests.sh'
push:
branches:
- fix/bounty-95-run-tests
paths:
- '.travis.yml'
- '.github/workflows/validate-travis-run-tests.yml'
- 'scripts/validate-travis-run-tests.sh'

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: chmod +x scripts/validate-travis-run-tests.sh
- run: ./scripts/validate-travis-run-tests.sh
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ matrix:
- llvm-toolchain-precise-3.7
- boost-latest
env:
- RUN_TEST=false
- RUN_TESTS=false
- OPENCL_LIB=khronos-icd
- OPENCL_VERSION="12"
- ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${OPENCL_ROOT}/lib/libOpenCL.so -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include"
Expand All @@ -184,7 +184,7 @@ matrix:
packages: *precise_icd_packages
sources: *precise_icd_sources
env:
- RUN_TEST=false
- RUN_TESTS=false
- OPENCL_LIB=khronos-icd
- OPENCL_VERSION="12"
- ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${OPENCL_ROOT}/lib/libOpenCL.so -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include"
Expand All @@ -197,7 +197,7 @@ matrix:
packages: *precise_icd_packages
sources: *precise_icd_sources
env:
- RUN_TEST=false
- RUN_TESTS=false
- OPENCL_LIB=khronos-icd
- OPENCL_VERSION="20"
- ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${OPENCL_ROOT}/lib/libOpenCL.so -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include"
Expand All @@ -210,7 +210,7 @@ matrix:
packages: *precise_icd_packages
sources: *precise_icd_sources
env:
- RUN_TEST=false
- RUN_TESTS=false
- OPENCL_LIB=khronos-icd
- OPENCL_VERSION="20"
- ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${OPENCL_ROOT}/lib/libOpenCL.so -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include"
Expand Down Expand Up @@ -316,6 +316,14 @@ install:
popd
fi

script:
- |
if [[ "${RUN_TESTS}" == "true" ]]; then
mvn test
else
mvn -DskipTests package
fi

after_success:
- bash <(curl -s https://codecov.io/bash)
- mvn site
Expand Down
27 changes: 27 additions & 0 deletions scripts/validate-travis-run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Validates RUN_TESTS / script section for Travis (issue #95).
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"'
Comment on lines +8 to +9

echo "==> global RUN_TESTS default"
grep -q 'RUN_TESTS=true' .travis.yml

echo "==> matrix uses RUN_TESTS (not RUN_TEST typo)"
if grep -q 'RUN_TEST=false' .travis.yml; then
echo "FAIL: found RUN_TEST=false typo; use RUN_TESTS=false"
exit 1
fi
grep -q 'RUN_TESTS=false' .travis.yml

echo "==> script section gates mvn test"
grep -q '^script:' .travis.yml
grep -q 'RUN_TESTS' .travis.yml
grep -q 'mvn test' .travis.yml
grep -q 'skipTests' .travis.yml
Comment on lines +12 to +25
Comment on lines +8 to +25

echo "All checks passed."