Skip to content

Commit

Permalink
chore(ci): caching for bundle and yarn dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kaddaSz committed Jul 25, 2023
1 parent aa6415b commit 2e7847e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
ruby-version: '3.2.1'
- name: Restore Bundle Dependencies
uses: actions/cache@v2
uses: actions/cache/restore@v3
id: cache-bundle-dependencies
env:
cache-name: cache-bundle-dependencies-v1
Expand All @@ -30,17 +30,17 @@ jobs:
if: steps.cache-bundle-dependencies.outputs.cache-hit != 'true'
run: bundle install
- name: Save Bundle Dependencies
uses: actions/cache@v2
uses: actions/cache/save@v3
if: steps.cache-bundle-dependencies.outputs.cache-hit != 'true'
env:
cache-name: cache-bundle-dependencies-v1
with:
path: |
vendor
bundle
.bundle
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('Gemfile.lock') }}
- name: Restore Yarn Dependencies
uses: actions/cache@v2
uses: actions/cache/restore@v3
id: cache-yarn-dependencies
env:
cache-name: cache-yarn-dependencies-v1
Expand All @@ -50,9 +50,14 @@ jobs:
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
- name: Install Yarn Dependencies
if: steps.cache-yarn-dependencies.outputs.cache-hit != 'true'
run: yarn install
env:
SAP_ARTIFACTORY_URL: ${{ secrets.SAP_ARTIFACTORY_URL }}
SAP_ARTIFACTORY_TOKEN: ${{ secrets.SAP_ARTIFACTORY_TOKEN }}
run: |
bundle exec fastlane add_token_to_npmrc
yarn install
- name: Save Yarn Dependencies
uses: actions/cache@v2
uses: actions/cache/save@v3
if: steps.cache-yarn-dependencies.outputs.cache-hit != 'true'
env:
cache-name: cache-yarn-dependencies-v1
Expand All @@ -62,6 +67,7 @@ jobs:
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
build:
runs-on: macos-13
needs: dependencies
steps:
- name: Check out repository code
uses: actions/checkout@v3
Expand All @@ -72,7 +78,7 @@ jobs:
with:
ruby-version: '3.2.1'
- name: Restore Bundle Dependencies
uses: actions/cache@v2
uses: actions/cache/restore@v3
id: cache-bundle-dependencies
env:
cache-name: cache-bundle-dependencies-v1
Expand All @@ -82,7 +88,7 @@ jobs:
.bundle
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('Gemfile.lock') }}
- name: Restore Yarn Dependencies
uses: actions/cache@v2
uses: actions/cache/restore@v3
id: cache-yarn-dependencies
env:
cache-name: cache-yarn-dependencies-v1
Expand Down
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ platform :ios do
end

desc "Add line with token to the SAP Artifactory"
private_lane :add_token_to_npmrc do
lane :add_token_to_npmrc do
sh(
command: "echo '//'#{ENV["SAP_ARTIFACTORY_URL"]}'/:always-auth=true' >> '../.npmrc'",
log: false
Expand Down

0 comments on commit 2e7847e

Please sign in to comment.