-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from samuelgiles/vscode
Get CI working after ownership change
- Loading branch information
Showing
79 changed files
with
147,306 additions
and
27,758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Ruby", | ||
"image": "mcr.microsoft.com/devcontainers/ruby:0-3.1", | ||
"postCreateCommand": "bin/setup" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,24 @@ | ||
--- | ||
name: Continuous Integration | ||
env: | ||
SLACK_CHANNEL_ID: C0317P7C9C2 | ||
on: | ||
push: | ||
branches-ignore: | ||
- refs/tags/*_staging | ||
- refs/tags/*_production | ||
|
||
on: push | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
ruby-version: ['3.1'] | ||
steps: | ||
- name: Checkout branch | ||
# Pin to v3.1.0 SHA | ||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
- name: Cache gems | ||
# Pin to 3.0.11 SHA | ||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 | ||
with: | ||
path: vendor/bundle | ||
key: "${{ runner.OS }}-gem-cache-${{ hashFiles('**/*.gemspec') | ||
}}" | ||
restore-keys: "${{ runner.OS }}-gem-cache-\n" | ||
# Pin to the v18 SHA | ||
- uses: "cachix/install-nix-action@daddc62a2e67d1decb56e028c9fa68344b9b7c2a" | ||
with: | ||
extra_nix_config: | | ||
post-build-hook = /etc/nix/upload-to-cache.sh | ||
substituters = https://cache.nixos.org/ | ||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | ||
nix_path: nixpkgs=channel:nixos-22.05 | ||
install_url: https://releases.nixos.org/nix/nix-2.7.0/install | ||
- name: Run CI through nix-shell | ||
env: | ||
GEMFURY_DEPLOY_TOKEN: ${{ secrets.GEMFURY_DEPLOY_TOKEN }} | ||
run: nix-shell --run "chmod 755 ./run_ci.sh && ./run_ci.sh" | ||
- name: Post to Slack if build fails | ||
if: failure() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/stable') | ||
# Pin to the v1.23.0 SHA | ||
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 | ||
env: | ||
SLACK_BOT_TOKEN: "${{ secrets.BELLROY_SLACK_TOKEN }}" | ||
with: | ||
channel-id: "${{ env.SLACK_CHANNEL_ID }}" | ||
payload: | | ||
{ | ||
"text": "* ${{ github.repository }} BUILD FAILURE*", | ||
"attachments": [ | ||
{ | ||
"fallback": "Failure summary", | ||
"color": "ff0000", | ||
"fields": [ | ||
{ | ||
"title": "Branch", | ||
"value": "${{ steps.extract_branch.outputs.branch}}" | ||
}, | ||
{ | ||
"title": "Who broke it", | ||
"value": "${{ github.actor }}" | ||
}, | ||
{ | ||
"title": "Build output", | ||
"value": "https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks", | ||
"short": false | ||
} | ||
] | ||
} | ||
] | ||
} | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
bundler-cache: true | ||
- name: Run RSpec tests | ||
run: bin/rspec | ||
- name: Check for Rubocop offenses | ||
run: bin/rubocop --format github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,22 @@ | ||
--- | ||
Documentation: | ||
Enabled: false | ||
Rails: | ||
Enabled: true | ||
inherit_gem: | ||
rubocop-shopify: rubocop.yml | ||
require: rubocop-rspec | ||
|
||
AllCops: | ||
Include: | ||
- app/**/*.rb | ||
- lib/**/*.rb | ||
- spec/**/*.rb | ||
Exclude: | ||
- app/assets/**/* | ||
- bin/**/* | ||
- client/node_modules/**/* | ||
- config/**/* | ||
- coverage/**/* | ||
- data/**/* | ||
- db/**/* | ||
- db_*/**/* | ||
- dw/**/* | ||
- log/**/* | ||
- phrase/**/* | ||
- public/**/* | ||
- tmp/**/* | ||
- vendor/**/* | ||
TargetRubyVersion: 2.5 | ||
Metrics/LineLength: | ||
Max: 100 | ||
Layout/MultilineMethodCallIndentation: | ||
EnforcedStyle: indented | ||
Style/PercentLiteralDelimiters: | ||
PreferredDelimiters: | ||
"%w": "[]" | ||
RSpec/ExampleLength: | ||
Enabled: false | ||
Max: 10 | ||
RSpec/MultipleExpectations: | ||
Enabled: false | ||
Max: 10 | ||
RSpec/NestedGroups: | ||
Enabled: false | ||
Max: 10 | ||
RSpec/MessageExpectation: | ||
NewCops: disable | ||
SuggestExtensions: false | ||
|
||
RSpec/LeakyConstantDeclaration: | ||
Enabled: false | ||
RSpec/MissingExampleGroupArgument: | ||
Enabled: false | ||
require: | ||
- rubocop-performance | ||
- rubocop-rspec | ||
- test_prof/rubocop | ||
Metrics/BlockLength: | ||
Enabled: false | ||
RSpec/MessageSpies: | ||
Enabled: false | ||
RSpec/ExpectInHook: | ||
|
||
RSpec/ExampleLength: | ||
Enabled: false | ||
RSpec/AggregateFailures: | ||
Enabled: true | ||
Include: | ||
- spec/**/*.rb | ||
Rails/InverseOf: | ||
|
||
RSpec/NamedSubject: | ||
Enabled: false | ||
Rails/Present: | ||
|
||
RSpec/MultipleExpectations: | ||
Enabled: false | ||
Rails/TimeZone: | ||
|
||
RSpec/VerifiedDoubles: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
source 'https://rubygems.org' | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
# Specify your gem's dependencies in rspec-sorbet.gemspec | ||
gemspec | ||
|
||
group :development, :test do | ||
gem 'guard-livereload', require: false | ||
gem 'guard-rspec' | ||
gem 'pry-byebug' | ||
gem 'rb-fsevent', require: false | ||
gem 'rspec' | ||
gem 'rubocop-rspec' | ||
gem 'rubocop' | ||
gem 'stackprof' | ||
gem 'tapioca' | ||
gem "guard-livereload", require: false | ||
gem "guard-rspec" | ||
gem "pry-byebug" | ||
gem "rb-fsevent", require: false | ||
gem "rspec" | ||
gem "rubocop-rspec" | ||
gem "rubocop-shopify" | ||
gem "rubocop" | ||
gem "stackprof" | ||
gem "tapioca" | ||
end | ||
|
||
group :test do | ||
gem 'ffaker' | ||
gem 'simplecov' | ||
gem "ffaker" | ||
gem "rspec-github", require: false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
require "bundler/gem_tasks" | ||
require "rspec/core/rake_task" | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec | ||
task default: :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# | ||
# This file was generated by Bundler. | ||
# | ||
# The application 'rspec' is installed as part of a gem, and | ||
# this file is here to facilitate running it. | ||
# | ||
|
||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) | ||
|
||
bundle_binstub = File.expand_path("bundle", __dir__) | ||
|
||
if File.file?(bundle_binstub) | ||
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ | ||
load(bundle_binstub) | ||
else | ||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. | ||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") | ||
end | ||
end | ||
|
||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
load Gem.bin_path("rspec-core", "rspec") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# | ||
# This file was generated by Bundler. | ||
# | ||
# The application 'rubocop' is installed as part of a gem, and | ||
# this file is here to facilitate running it. | ||
# | ||
|
||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) | ||
|
||
bundle_binstub = File.expand_path("bundle", __dir__) | ||
|
||
if File.file?(bundle_binstub) | ||
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ | ||
load(bundle_binstub) | ||
else | ||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. | ||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") | ||
end | ||
end | ||
|
||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
load Gem.bin_path("rubocop", "rubocop") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,3 @@ IFS=$'\n\t' | |
set -vx | ||
|
||
bundle install | ||
|
||
# Do any other automated setup that you need to do here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.