Improve tests and workflows #6
Workflow file for this run
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
name: Unit Tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [develop] | |
# Limit only the latest workflow created to run | |
concurrency: | |
group: build | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: macos-13 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache Swift Packages | |
id: cache-spm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-swift-packages | |
with: | |
path: ./.build | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Package.resolved') }} | |
- name: Cache Ruby Packages | |
id: cache-ruby | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-ruby-packages | |
with: | |
path: ./vendor | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Gemfile.lock') }} | |
- name: Cache Homebrew Packages | |
id: cache-homebrew | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-homebrew-packages | |
with: | |
path: /opt/homebrew/Cellar | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Brewfile.lock.json') }} | |
- name: Xcode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Install Gem Dependencies | |
if: ${{ steps.cache-ruby.outputs.cache-hit != 'true' }} | |
run: bundle install --path vendor/bundle | |
- name: Install Homebrew Dependencies/ | |
if: ${{ steps.cache-homebrew.outputs.cache-hit != 'true' }} | |
run: brew bundle | |
- name: List Homebrew directory | |
run: brew --prefix swiftformat | |
- name: Run Unit Tests | |
run: bundle exec fastlane ios unit_tests |