Skip to content

Commit b9a12b2

Browse files
authored
Merge pull request #7 from codeur/feature/add-gha
Add test workflow
2 parents 5bf7626 + 1af93b3 commit b9a12b2

File tree

4 files changed

+148
-3
lines changed

4 files changed

+148
-3
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Test
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
ruby: [ '2.6' ]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up Ruby ${{ matrix.ruby }}
18+
uses: actions/setup-ruby@v1
19+
with:
20+
ruby-version: ${{ matrix.ruby }}
21+
22+
- name: Retrieve gems cache
23+
uses: actions/[email protected]
24+
with:
25+
path: vendor/bundle
26+
key: ${{ runner.os }}-${{ matrix.ruby }}-gem-${{ hashFiles('**/Gemfile.lock') }}
27+
28+
- name: Install gems
29+
run: |
30+
rm -f .ruby-version
31+
bundle config path vendor/bundle
32+
bundle install --jobs 4 --retry 3
33+
34+
- name: Run tests
35+
run: bundle exec rake test
36+
37+
- name: Upload log if failure
38+
uses: actions/upload-artifact@v1
39+
if: failure()
40+
with:
41+
name: test.log
42+
path: log/test.log

.rubocop.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
AllCops:
2+
TargetRubyVersion: 2.4
3+
4+
Layout/AccessModifierIndentation:
5+
EnforcedStyle: outdent
6+
IndentationWidth: 2
7+
8+
Layout/ArgumentAlignment:
9+
EnforcedStyle: with_fixed_indentation
10+
IndentationWidth: 2
11+
12+
Layout/FirstArrayElementIndentation:
13+
EnforcedStyle: consistent
14+
15+
Layout/FirstHashElementIndentation:
16+
EnforcedStyle: consistent
17+
18+
Layout/HashAlignment:
19+
EnforcedHashRocketStyle: table
20+
EnforcedColonStyle: table
21+
22+
Layout/MultilineMethodCallIndentation:
23+
EnforcedStyle: indented
24+
25+
Layout/ParameterAlignment:
26+
EnforcedStyle: with_fixed_indentation
27+
IndentationWidth: 2
28+
29+
Lint/RaiseException:
30+
Enabled: true
31+
32+
Lint/StructNewOverride:
33+
Enabled: true
34+
35+
Metrics/AbcSize:
36+
Max: 65
37+
38+
Metrics/BlockLength:
39+
Max: 70
40+
41+
Metrics/ClassLength:
42+
Max: 300
43+
44+
Metrics/CyclomaticComplexity:
45+
Max: 10
46+
47+
Metrics/MethodLength:
48+
Max: 60
49+
50+
Metrics/ModuleLength:
51+
Max: 300
52+
53+
Metrics/PerceivedComplexity:
54+
Max: 10
55+
56+
Naming/FileName:
57+
Enabled: false
58+
59+
Style/AsciiComments:
60+
Enabled: false
61+
62+
Style/ClassAndModuleChildren:
63+
AutoCorrect: true
64+
65+
Style/ConditionalAssignment:
66+
Enabled: false
67+
68+
Style/Documentation:
69+
Enabled: false
70+
71+
Style/EmptyMethod:
72+
EnforcedStyle: expanded
73+
74+
Style/GuardClause:
75+
MinBodyLength: 3
76+
77+
Style/HashEachMethods:
78+
Enabled: true
79+
AutoCorrect: true
80+
81+
Style/HashTransformKeys:
82+
Enabled: true
83+
AutoCorrect: true
84+
85+
Style/HashTransformValues:
86+
Enabled: true
87+
AutoCorrect: true
88+
89+
Style/IfUnlessModifier:
90+
Enabled: false
91+
92+
Style/MultipleComparison:
93+
Enabled: false
94+
95+
Style/NumericPredicate:
96+
Enabled: false
97+
98+
Style/SymbolArray:
99+
MinSize: 7

capistrano-sentry.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
1010
spec.authors = ['Brice Texier']
1111
spec.email = ['[email protected]']
1212
spec.description = 'Sentry release/deployment integration'
13-
spec.summary = 'Sentry release/deployment integration'
13+
spec.summary = 'Push release and deployment information on Sentry on each deploy'
1414
spec.homepage = 'https://github.com/codeur/capistrano-sentry'
1515
spec.license = 'MIT'
1616

lib/capistrano/tasks/sentry.rake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ namespace :sentry do
2121
info '[sentry:validate_config] Validating Sentry notification config'
2222
api_token = ENV['SENTRY_API_TOKEN'] || fetch(:sentry_api_token)
2323
if api_token.blank?
24-
msg = 'Missing SENTRY_API_TOKEN. Please set SENTRY_API_TOKEN environment variable or `set :sentry_api_token` in your `config/deploy.rb` file for your Rails application.'
24+
msg = 'Missing SENTRY_API_TOKEN. Please set SENTRY_API_TOKEN environment' \
25+
' variable or `set :sentry_api_token` in your `config/deploy.rb` file for your Rails application.'
2526
warn msg
2627
raise Capistrano::SentryConfigurationError, msg
2728
end
@@ -71,7 +72,10 @@ namespace :sentry do
7172
response = http.request(req)
7273
if response.is_a? Net::HTTPSuccess
7374
info "Notified Sentry of new release: #{release_version}"
74-
req = Net::HTTP::Post.new("/api/0/organizations/#{organization_slug}/releases/#{release_version}/deploys/", headers)
75+
req = Net::HTTP::Post.new(
76+
"/api/0/organizations/#{organization_slug}/releases/#{release_version}/deploys/",
77+
headers
78+
)
7579
req.body = JSON.generate(
7680
environment: environment,
7781
name: deploy_name

0 commit comments

Comments
 (0)