Skip to content

Commit

Permalink
Parallelize swift linters in CI (airbnb#1434)
Browse files Browse the repository at this point in the history
  • Loading branch information
calda committed Dec 10, 2021
1 parent 1d3a19c commit 1b01316
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ on:

jobs:
build-package:
name: "Build Package"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build Package
run: brew install mint && bundle install && bundle exec rake build:package:all
build-example:
name: "Build Example App"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build Example
run: brew install mint && bundle install && bundle exec rake build:example:all
test-package:
name: "Test Package"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -34,9 +37,17 @@ jobs:
with:
name: TestArtifacts
path: Tests/Artifacts
lint-swift:
swiftlint:
name: "Lint Swift (SwiftLint)"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Lint Swift
run: brew install mint && bundle install && bundle exec rake lint:swift
- name: Lint Swift using SwiftLint
run: brew install mint && bundle install && bundle exec rake lint:swift:swiftlint
swiftformat:
name: "Lint Swift (SwiftFormat)"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Lint Swift using SwiftFormat
run: brew install mint && bundle install && bundle exec rake lint:swift:swiftformat
16 changes: 13 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,19 @@ end

namespace :lint do
desc 'Lints swift files'
task :swift do
sh 'mint run SwiftLint lint Sources Tests Example Package.swift --config script/lint/swiftlint.yml --strict'
sh 'mint run SwiftFormat Sources Tests Example Package.swift --config script/lint/airbnb.swiftformat --lint'
task swift: ['swift:swiftlint', 'swift:swiftformat']

desc 'Lints swift files'
namespace :swift do
desc 'Lints swift files using SwiftLint'
task :swiftlint do
sh 'mint run SwiftLint lint Sources Tests Example Package.swift --config script/lint/swiftlint.yml --strict'
end

desc 'Lints swift files using SwiftLint'
task :swiftformat do
sh 'mint run SwiftFormat Sources Tests Example Package.swift --config script/lint/airbnb.swiftformat --lint'
end
end
end

Expand Down

0 comments on commit 1b01316

Please sign in to comment.