Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIT-58: Add Github Actions workflow for caching dependencies #21

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/cache-dependencies.yml
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