File tree Expand file tree Collapse file tree 3 files changed +66
-1
lines changed Expand file tree Collapse file tree 3 files changed +66
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ sudo: false
5
5
before_install :
6
6
- gem update --system
7
7
- gem install bundler
8
- script : bin/rake
8
+ before_script :
9
+ - " bin/ci-code-review"
10
+ script : bin/ci
9
11
rvm :
10
12
- 2.5.0
11
13
env :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # script/ci: Setup environment for CI to run tests. This is primarily
4
+ # designed to run on the continuous integration server.
5
+
6
+ set -e
7
+ cd " $( dirname " $0 " ) /.."
8
+
9
+ # setup environment
10
+ export DEFAULT_HOST=" https://account.radiusnetworks.com"
11
+ export RAILS_ROOT=" $( cd " $( dirname " $0 " ) " /.. && pwd) "
12
+ export RAILS_ENV=" test"
13
+ export RACK_ENV=" test"
14
+ export RACK_ROOT=" $RAILS_ROOT "
15
+
16
+ # Run the specs for the rails app
17
+ echo " ---> Running tests"
18
+ ./bin/rspec --require rails_helper
19
+
20
+ # Script for running Rubocop
21
+ # A Ruby static code analyzer, based on the community Ruby style guide.
22
+ # http://rubocop.readthedocs.io
23
+ echo " ---> Running rubocop"
24
+ ./bin/rubocop --config .rubocop.yml --lint
25
+
26
+ # Script for running Brakeman tests
27
+ # Brakeman is a security scanner
28
+ # https://github.com/presidentbeef/brakeman.
29
+ echo " ---> Running breakman"
30
+ gem install --no-rdoc --no-ri brakeman slim coffee-rails
31
+ brakeman --run-all-checks --exit-on-warn --ignore-config config/brakeman.ignore .
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Requires REVIEWDOG_GITHUB_API_TOKEN to be set in the envionment. We use a
4
+ # token from the admin account so that the comments look as if they come from
5
+ # Radbot.
6
+
7
+ # See:
8
+ # - https://docs.travis-ci.com/user/environment-variables/#Convenience-Variables
9
+ # - https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
10
+ # - https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
11
+ if [[ " $TRAVIS_PULL_REQUEST " = " false" ]] || [[ " $TRAVIS_BRANCH " = " production" ]]; then
12
+ exit
13
+ fi
14
+
15
+ set -e
16
+ cd " $( dirname " $0 " ) /.."
17
+
18
+ REVIEWDOG_VERSION=" 0.9.9"
19
+
20
+ if ! [ " $( ./bin/reviewdog -version) " = " $REVIEWDOG_VERSION " ]; then
21
+ echo " Installing reviewdog version ${REVIEWDOG_VERSION} ..."
22
+ curl -fsSL https://github.com/haya14busa/reviewdog/releases/download/$REVIEWDOG_VERSION /reviewdog_linux_amd64 \
23
+ -o ./bin/reviewdog
24
+ chmod +x ./bin/reviewdog
25
+ fi
26
+
27
+ echo Rubocop Version: $( ./bin/rubocop --version)
28
+ echo Review Dog Version: $( ./bin/reviewdog -version)
29
+
30
+ # Add `-diff="git diff master"` to reviewdog args when running locally
31
+ ./bin/rubocop --config .rubocop.yml --extra-details --display-style-guide --rails | \
32
+ ./bin/reviewdog -f=rubocop -reporter=github-pr-check
You can’t perform that action at this time.
0 commit comments