Skip to content

Commit b023b09

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

4 files changed

Lines changed: 92 additions & 56 deletions

File tree

.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: "Setting up Ruby"
35+
uses: ruby/setup-ruby@v1
36+
with:
37+
bundler-cache: true
38+
39+
- name: "Update and Install Dependencies"
40+
run: |
41+
sudo apt update
42+
sudo apt install libcurl4 libcurl4-openssl-dev
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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ gem 'rake', '~> 13.3'
2424
gem 'activerecord', '~> 8.1'
2525
gem 'otr-activerecord', '~> 2.6.0'
2626
gem 'sqlite3', '~> 2.8'
27-
gem 'rubocop', '~> 1.81.7', require: false
2827

2928
# Geolocation support
3029
group :geoip do
@@ -87,4 +86,8 @@ group :test do
8786
gem 'capybara', '~> 3.40'
8887
end
8988

89+
group :development, :test do
90+
gem 'rubocop', '~> 1.81.7', require: false
91+
end
92+
9093
source 'https://rubygems.org'

0 commit comments

Comments
 (0)