Skip to content

Commit

Permalink
Optimize GitHub Actions mint cache (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
Econa77 authored Oct 9, 2023
1 parent 074cd6e commit 58e0102
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 30 deletions.
43 changes: 14 additions & 29 deletions .github/workflows/Danger.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Danger
on: pull_request
on:
pull_request:
push:
branches:
- master
permissions:
pull-requests: write
jobs:
Expand All @@ -13,34 +17,14 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_15.0.app/Contents/Developer
- name: Cache RubyGems
uses: actions/cache@v1
bundler-cache: true
- name: Cache Mint
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
path: .mint
key: ${{ runner.os }}-mint-${{ env.SWIFTLINT_VERSION }}
restore-keys: |
${{ runner.os }}-gem-
- name: Cache Mint Builds
uses: actions/cache@v1
with:
path: ${{ env.MINT_PATH }}
key: ${{ runner.os }}-mint-build-${{ env.SWIFTLINT_VERSION }}
restore-keys: |
${{ runner.os }}-mint-build-
- name: Cache Mint Links
uses: actions/cache@v1
with:
path: ${{ env.MINT_LINK_PATH }}
key: ${{ runner.os }}-mint-link-${{ env.SWIFTLINT_VERSION }}
restore-keys: |
${{ runner.os }}-mint-link-
- name: Bundle install
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
${{ runner.os }}-mint-
- name: Install Mint and Packages
run: |
brew install mint
Expand All @@ -50,6 +34,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
env:
MINT_PATH: ${{ github.workspace }}/mint
MINT_LINK_PATH: ${{ github.workspace }}/mint/bin
MINT_PATH: .mint/lib
MINT_LINK_PATH: .mint/bin
SWIFTLINT_VERSION: 0.53.0
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
2 changes: 1 addition & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.dismiss_out_of_range_messages
swiftlint.config_file = '.swiftlint.yml'
swiftlint.binary_path = './mint/bin/swiftlint'
swiftlint.binary_path = '.mint/bin/swiftlint'
swiftlint.lint_files(inline_mode: true)

0 comments on commit 58e0102

Please sign in to comment.