Skip to content

Commit 42d0eca

Browse files
author
MarcoFalke
committed
Merge #13728: lint: Run the CI lint stage on mac
cd82f75 lint: Install grep and git via brew on mac for --perl-regexp (Ben Woosley) eafa747 lint: Fix shellcheck SC2155 (Ben Woosley) 615ff4e lint: Run the linters against Mac OS on Travis (Ben Woosley) Pull request description: This helps ensure ongoing compatibility with macOS-distributed version of GNU bash. ACKs for top commit: MarcoFalke: ACK cd82f75 Tree-SHA512: 8d56d2303bbebedba8ea2291f4ab35b7fdf3245b7a4c3f04557eee4f19d83573798ad32facc92bfa060aaeb294e6d2c95e6d1c3b795fd7951dcf3aa1cccec107
2 parents a2ae766 + cd82f75 commit 42d0eca

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

.travis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,28 @@ jobs:
8888
script:
8989
- set -o errexit; source ./ci/extended_lint/06_script.sh
9090

91+
- stage: extended-lint
92+
name: 'lint macOS 10.12 (compat)'
93+
os: osx
94+
# Use the earliest macOS that can build our lint dependencies:
95+
# Xcode 8.3.3, macOS 10.12, JDK 1.8.0_112-b16
96+
# https://docs.travis-ci.com/user/reference/osx/#OS-X-Version
97+
osx_image: xcode8.3
98+
# TODO: if you're updating osx_image, try using "rvm:" to supply the
99+
# version of ruby required by homebrew. Despite this "rvm:" declaration,
100+
# brew update installs ruby 2.3.7 as its first action.
101+
language: ruby
102+
rvm:
103+
- 2.3.7
104+
env:
105+
cache: false
106+
install:
107+
- set -o errexit; source ./ci/lint/04_install.sh
108+
before_script:
109+
- set -o errexit; source ./ci/lint/05_before_script.sh
110+
script:
111+
- set -o errexit; source ./ci/lint/06_script.sh
112+
91113
- stage: test
92114
name: 'ARM [GOAL: install] [unit tests, no functional tests]'
93115
env: >-

ci/lint/04_install.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,22 @@
66

77
export LC_ALL=C
88

9+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
10+
# update first to install required ruby dependency
11+
travis_retry brew update
12+
travis_retry brew reinstall git -- --with-pcre2 # for --perl-regexp
13+
travis_retry brew install grep # gnu grep for --perl-regexp support
14+
PATH="$(brew --prefix grep)/libexec/gnubin:$PATH"
15+
travis_retry brew install shellcheck
16+
travis_retry brew upgrade python
17+
PATH="$(brew --prefix python)/bin:$PATH"
18+
export PATH
19+
else
20+
SHELLCHECK_VERSION=v0.6.0
21+
travis_retry curl --silent "https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
22+
PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"
23+
export PATH
24+
fi
25+
926
travis_retry pip3 install codespell==1.15.0
1027
travis_retry pip3 install flake8==3.7.8
11-
12-
SHELLCHECK_VERSION=v0.6.0
13-
curl -s "https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
14-
export PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"

0 commit comments

Comments
 (0)