Skip to content

Commit

Permalink
Configure Danger, enforce labels (#1761)
Browse files Browse the repository at this point in the history
  • Loading branch information
vegaro authored Aug 5, 2022
1 parent ea4bab3 commit 496b5bd
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 11 deletions.
27 changes: 25 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,12 @@ commands:
name: Create simulator
command: xcrun simctl create '<< parameters.sim-name >>' com.apple.CoreSimulator.SimDeviceType.<< parameters.sim-device-type >> com.apple.CoreSimulator.SimRuntime.<< parameters.sim-device-runtime >>

install-dependencies:
bundle-install-with-cache:
parameters:
directory:
type: string
default: .
steps:
# Bundler
- restore_cache:
keys:
- v1-gem-cache-{{ checksum "Gemfile.lock" }}
Expand All @@ -83,6 +82,15 @@ commands:
key: v1-gem-cache-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle

install-dependencies:
parameters:
directory:
type: string
default: .
steps:
- bundle-install-with-cache:
directory: << parameters.directory >>
- run:
name: Install swiftlint
command: brew install swiftlint
Expand Down Expand Up @@ -480,6 +488,18 @@ jobs:
- store_artifacts:
path: fastlane/test_output

danger:
docker:
- image: cimg/ruby:3.1.2
working_directory: ~/purchases-ios
shell: /bin/bash --login -o pipefail
steps:
- checkout
- bundle-install-with-cache
- run:
name: Run Danger
command: bundle exec danger --verbose

workflows:
version: 2
build-test:
Expand Down Expand Up @@ -534,3 +554,6 @@ workflows:
- docs-deploy:
xcode_version: '14.0.0'
<<: *release-tags
danger:
jobs:
- danger
11 changes: 11 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def fail_if_no_supported_label_found
supported_types = ["breaking", "build", "ci", "docs", "feat", "fix", "perf", "refactor", "style", "test"]

supported_labels_in_pr = supported_types & github.pr_labels
no_supported_label = supported_labels_in_pr.empty?
if no_supported_label
fail("Label the PR using one of the change type labels: #{supported_types}")
end
end

fail_if_no_supported_label_found
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ gem 'fastlane'
gem 'cocoapods'
gem 'jazzy'
gem 'cocoapods-trunk'
gem 'danger'
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
54 changes: 45 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/RevenueCat/fastlane-plugin-revenuecat_internal
revision: 086656f3a2cbf47ee2cdf9f6ee3cf6fb5d4275c0
revision: 4082cf43e9a21b61adbb53456e4692bb1e4257bf
specs:
fastlane-plugin-revenuecat_internal (0.1.0)

Expand All @@ -9,7 +9,7 @@ GEM
specs:
CFPropertyList (3.0.5)
rexml
activesupport (6.1.6)
activesupport (6.1.6.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -23,8 +23,8 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.613.0)
aws-sdk-core (3.131.5)
aws-partitions (1.615.0)
aws-sdk-core (3.131.6)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
Expand All @@ -40,6 +40,10 @@ GEM
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.1.0)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
cocoapods (1.11.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
Expand Down Expand Up @@ -82,6 +86,21 @@ GEM
commander (4.6.0)
highline (~> 2.0.0)
concurrent-ruby (1.1.10)
cork (0.3.0)
colored2 (~> 3.1)
danger (8.6.1)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
cork (~> 0.1)
faraday (>= 0.9.0, < 2.0)
faraday-http-cache (~> 2.0)
git (~> 1.7)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
no_proxy_fix
octokit (~> 4.7)
terminal-table (>= 1, < 4)
declarative (0.0.20)
digest-crc (0.6.4)
rake (>= 12.0.0, < 14.0.0)
Expand Down Expand Up @@ -111,6 +130,8 @@ GEM
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-http-cache (2.4.0)
faraday (>= 0.8)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
Expand Down Expand Up @@ -166,6 +187,8 @@ GEM
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
git (1.11.0)
rchardet (~> 1.8)
google-apis-androidpublisher_v3 (0.25.0)
google-apis-core (>= 0.7, < 2.a)
google-apis-core (0.7.0)
Expand Down Expand Up @@ -208,7 +231,7 @@ GEM
http-cookie (1.0.5)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.10.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jazzy (0.14.2)
cocoapods (~> 1.5)
Expand All @@ -223,11 +246,15 @@ GEM
jmespath (1.6.1)
json (2.6.2)
jwt (2.4.1)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liferaft (0.0.6)
memoist (0.16.2)
mini_magick (4.11.0)
mini_mime (1.1.2)
minitest (5.15.0)
minitest (5.16.2)
molinillo (0.8.0)
multi_json (1.15.0)
multipart-post (2.0.0)
Expand All @@ -236,12 +263,17 @@ GEM
nap (1.1.0)
naturally (2.2.1)
netrc (0.11.0)
no_proxy_fix (0.1.2)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
open4 (1.3.4)
optparse (0.1.1)
os (1.1.4)
plist (3.6.0)
public_suffix (4.0.7)
rake (13.0.6)
rchardet (1.8.0)
redcarpet (3.5.1)
representable (3.2.0)
declarative (< 0.1.0)
Expand All @@ -255,6 +287,9 @@ GEM
rubyzip (2.3.2)
sassc (2.4.0)
ffi (~> 1.9)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
security (0.1.3)
signet (0.17.0)
addressable (~> 2.8)
Expand All @@ -264,7 +299,7 @@ GEM
simctl (1.6.8)
CFPropertyList
naturally
sqlite3 (1.4.2)
sqlite3 (1.4.4)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
Expand All @@ -275,7 +310,7 @@ GEM
tty-cursor (~> 0.7)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unf (0.1.4)
Expand All @@ -297,14 +332,15 @@ GEM
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
zeitwerk (2.5.4)
zeitwerk (2.6.0)

PLATFORMS
ruby

DEPENDENCIES
cocoapods
cocoapods-trunk
danger
fastlane
fastlane-plugin-create_xcframework
fastlane-plugin-revenuecat_internal!
Expand Down

0 comments on commit 496b5bd

Please sign in to comment.