generated from bitwarden/template
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BIT-58: Add Github Actions workflow for caching dependencies (#21)
- Loading branch information
1 parent
a463db7
commit 6d0e4dd
Showing
1 changed file
with
54 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
name: Cache Dependencies | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer | ||
MINT_LINK_PATH: .mint/bin | ||
MINT_PATH: .mint/lib | ||
|
||
jobs: | ||
cache-dependencies: | ||
name: Cache Dependencies | ||
runs-on: macos-13 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0 | ||
with: | ||
bundler-cache: true | ||
ruby-version: 3.2.2 | ||
|
||
- name: Cache Mint Packages | ||
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | ||
with: | ||
path: .mint | ||
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }} | ||
restore-keys: | | ||
${{ runner.os }}-mint- | ||
- name: Cache SPM Packages | ||
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | ||
with: | ||
path: build/DerivedData/SourcePackages | ||
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | ||
restore-keys: | | ||
${{ runner.os }}-spm- | ||
- name: Setup | ||
run: | | ||
brew install mint xcbeautify | ||
./Scripts/bootstrap.sh | ||
- name: Update Xcode Dependencies | ||
run: | | ||
set -o pipefail && \ | ||
xcodebuild -resolvePackageDependencies \ | ||
-project Bitwarden.xcodeproj \ | ||
-clonedSourcePackagesDirPath build/DerivedData/SourcePackages |