Skip to content

Commit b25b564

Browse files
committed
Run RuboCop in CI
1 parent 9769be2 commit b25b564

File tree

4 files changed

+94
-58
lines changed

4 files changed

+94
-58
lines changed

.github/workflows/github_actions.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "RuboCop"
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
rubocop:
9+
name: "RuboCop Analysis"
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: "Checkout the repository"
13+
uses: actions/checkout@v4
14+
with:
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
fetch-depth: 2
17+
18+
- name: "Setting up Ruby"
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
bundler-cache: true
22+
23+
- name: "Configure Bundle testing and install gems"
24+
run: |
25+
bundle config unset --local without
26+
bundle config set --local with 'development'
27+
bundle install
28+
29+
- name: "Run RuboCop"
30+
run: |
31+
bundle exec rubocop --display-only-safe-correctable

.github/workflows/test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "BrowserStack Test"
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
ubuntu-job:
9+
name: "BrowserStack Test on Ubuntu"
10+
runs-on: ubuntu-latest # Can be self-hosted runner also
11+
environment:
12+
name: Integrate Pull Request
13+
env:
14+
GITACTIONS: true
15+
steps:
16+
- name: "BrowserStack Env Setup" # Invokes the setup-env action
17+
uses: browserstack/github-actions/setup-env@master
18+
with:
19+
username: ${{ secrets.BROWSERSTACK_USERNAME }}
20+
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
21+
22+
- name: "BrowserStack Local Tunnel Setup" # Invokes the setup-local action
23+
uses: browserstack/github-actions/setup-local@master
24+
with:
25+
local-testing: start
26+
local-identifier: random
27+
28+
- name: "Checkout the repository"
29+
uses: actions/checkout@v4
30+
with:
31+
ref: ${{ github.event.pull_request.head.sha }}
32+
fetch-depth: 2
33+
34+
- name: "Update and Install Dependencies"
35+
run: |
36+
sudo apt update
37+
sudo apt install libcurl4 libcurl4-openssl-dev
38+
39+
- name: "Setting up Ruby"
40+
uses: ruby/setup-ruby@v1
41+
with:
42+
bundler-cache: true
43+
44+
- name: "Configure Bundle testing and install gems"
45+
run: |
46+
bundle config unset --local without
47+
bundle config set --local with 'test'
48+
bundle install
49+
50+
- name: "Run BrowserStack simple verification"
51+
run: |
52+
bundle exec rake browserstack --trace
53+
54+
- name: "BrowserStackLocal Stop" # Terminating the BrowserStackLocal tunnel connection
55+
uses: browserstack/github-actions/setup-local@master
56+
with:
57+
local-testing: stop

Gemfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# See the file 'doc/COPYING' for copying permission
55
#
66

7+
source 'https://rubygems.org'
8+
79
gem 'net-smtp', require: false
810
gem 'json'
911

@@ -24,7 +26,6 @@ gem 'rake', '~> 13.3'
2426
gem 'activerecord', '~> 8.1'
2527
gem 'otr-activerecord', '~> 2.6.0'
2628
gem 'sqlite3', '~> 2.8'
27-
gem 'rubocop', '~> 1.81.7', require: false
2829

2930
# Geolocation support
3031
group :geoip do
@@ -59,6 +60,10 @@ group :ext_qrcode do
5960
gem 'qr4r', '~> 0.6.1'
6061
end
6162

63+
group :development do
64+
gem 'rubocop', '~> 1.81.7', require: false
65+
end
66+
6267
# For running unit tests
6368
group :test do
6469
gem 'test-unit-full', '~> 0.0.5'
@@ -86,5 +91,3 @@ group :test do
8691
# sudo port install libxml2 libxslt
8792
gem 'capybara', '~> 3.40'
8893
end
89-
90-
source 'https://rubygems.org'

0 commit comments

Comments
 (0)