Skip to content

Commit

Permalink
test action.yml added
Browse files Browse the repository at this point in the history
  • Loading branch information
sajib-ghosh-iOS committed Feb 17, 2024
1 parent 8c21d27 commit e2bcd2f
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Set up environment
description: Set up the environment for building and testing the library on a given platform

inputs:
xcode:
description: The version of Xcode to use
required: true

runs:
using: composite

steps:
- name: Set Ruby version
run: ruby -e 'puts RUBY_VERSION' | tee .ruby-version
shell: bash

- name: Set up Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939
with:
bundler-cache: true
cache-version: 1

- name: Setup Xcode
uses: mxcl/xcodebuild@6e60022a0cbe8c89278be2dd1773a2f68e7c5c87
with:
xcode: ${{ inputs.xcode }}
action: none
45 changes: 45 additions & 0 deletions .github/workflows/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run tests
description: Run library tests for a given platform

inputs:
xcode:
description: The version of Xcode to use
required: true
scheme:
description: The Xcode scheme to use
required: true
platform:
description: The platform to build for
required: true

runs:
using: composite

steps:
- name: Install xcpretty
run: gem install xcpretty
shell: bash

- name: Save Xcode version
run: xcodebuild -version | tee .xcode-version
shell: bash

- id: restore-carthage-cache
name: Restore Carthage cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: Carthage
key: carthage-${{ inputs.platform }}-${{ hashFiles('Cartfile.resolved') }}-${{ hashFiles('.xcode-version') }}-v1

- name: Install dependencies
if: steps.restore-carthage-cache.outputs.cache-hit != 'true'
run: carthage bootstrap --platform ${{ inputs.platform }} --use-xcframeworks --no-use-binaries --cache-builds
shell: bash

- name: Run tests
uses: mxcl/xcodebuild@6e60022a0cbe8c89278be2dd1773a2f68e7c5c87
with:
xcode: ${{ inputs.xcode }}
scheme: ${{ inputs.scheme }}
platform: ${{ inputs.platform }}
code-coverage: true

0 comments on commit e2bcd2f

Please sign in to comment.