Skip to content

Commit 615ff4e

Browse files
committed
lint: Run the linters against Mac OS on Travis
This helps ensure ongoing compatibility with macOS-distributed version of GNU bash.
1 parent c08bf2b commit 615ff4e

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-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] [no unit or functional tests]'
93115
env: >-

ci/lint/04_install.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@
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 install shellcheck
13+
travis_retry brew upgrade python
14+
export PATH="$(brew --prefix python)/bin:$PATH"
15+
else
16+
SHELLCHECK_VERSION=v0.6.0
17+
travis_retry curl --silent "https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
18+
export PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"
19+
fi
20+
921
travis_retry pip3 install codespell==1.15.0
1022
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)