-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nikita Korobeinikov
committed
Mar 22, 2021
1 parent
ba13258
commit b566522
Showing
3 changed files
with
41 additions
and
14 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 |
---|---|---|
@@ -1,21 +1,28 @@ | ||
name: SwiftLint | ||
name: Danger | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/Lint.yml' | ||
- '.swiftlint.yml' | ||
- 'Sources/**/*.swift' | ||
|
||
jobs: | ||
SwiftLint: | ||
danger: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' # if only run pull request when multiple trigger workflow | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Fetch base ref | ||
run: git fetch --no-tags --prune --depth=1 origin ${{ github.base_ref }} | ||
- name: GitHub Action for SwiftLint (Only files changed in the PR) | ||
uses: norio-nomura/[email protected] | ||
env: | ||
WORKING_DIRECTORY: Sources | ||
DIFF_BASE: origin/${{ github.base_ref }} | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.6' | ||
- uses: actions/cache@v1 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('Gemfile') }} # change your gemfile path | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- uses: MeilCli/danger-action@v5 | ||
with: | ||
plugins_file: 'Gemfile' | ||
install_path: 'vendor/bundle' | ||
danger_file: 'Dangerfile' | ||
danger_id: 'danger-pr' | ||
env: | ||
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,7 @@ | ||
|
||
|
||
swiftlint.config_file = '.swiftlint.yml' | ||
swiftlint.max_num_violations = 20 | ||
swiftlint.lint_files inline_mode: true | ||
|
||
the_coding_love.random |
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,13 @@ | ||
source "https://rubygems.org" | ||
|
||
# Ensure github repositories are fetched using HTTPS | ||
git_source(:github) do |repo_name| | ||
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") | ||
puts(repo_name) | ||
"https://github.com/#{repo_name}.git" | ||
end if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('2') | ||
|
||
gem 'cocoapods', "1.7.3" | ||
gem 'danger' | ||
gem 'danger-the_coding_love' | ||
gem 'danger-swiftlint' |