91 lines
2.3 KiB
YAML
91 lines
2.3 KiB
YAML
on:
|
||
pull_request:
|
||
push:
|
||
branches:
|
||
- main
|
||
|
||
jobs:
|
||
check:
|
||
runs-on: macos-10.15
|
||
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
include:
|
||
|
||
- platform: iOS
|
||
lane: test_iOS12
|
||
|
||
- platform: iOS
|
||
lane: test_iOS11
|
||
|
||
- platform: tvOS
|
||
lane: test_tvOS12
|
||
|
||
- platform: macOS
|
||
lane: test_macOS
|
||
|
||
env:
|
||
LC_CTYPE: en_US.UTF-8
|
||
LANG: en_US.UTF-8
|
||
ABLY_ENV: sandbox
|
||
|
||
steps:
|
||
- uses: actions/checkout@v2
|
||
|
||
- uses: actions/cache@v2
|
||
id: carthage-cache
|
||
with:
|
||
path: Carthage
|
||
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-carthage-
|
||
|
||
- name: Reset Simulators
|
||
run: xcrun simctl erase all
|
||
|
||
- name: Install Dependencies
|
||
run: |
|
||
make submodules
|
||
bundle install
|
||
|
||
- name: Carthage
|
||
if: steps.carthage-cache.outputs.cache-hit != 'true'
|
||
run: |
|
||
make update_carthage_dependencies
|
||
|
||
- name: Run Tests
|
||
run: bundle exec fastlane ${{ matrix.lane }}
|
||
|
||
# This is the script specified as the pod’s prepare_command in its Podspec.
|
||
# It would be run automatically for a normal CocoaPods install, but it doesn’t
|
||
# get run when the dependency is specified with the :path option. So we run it
|
||
# manually.
|
||
- name: Prepare Pod
|
||
run: Scripts/prepare-pod.sh
|
||
|
||
- name: Run Examples Tests
|
||
working-directory: ./Examples/Tests
|
||
run: |
|
||
pod repo update
|
||
pod install
|
||
bundle exec fastlane scan -s Tests
|
||
|
||
- name: Xcodebuild Logs Artifact
|
||
if: always()
|
||
uses: actions/upload-artifact@v2
|
||
with:
|
||
name: xcodebuild-logs
|
||
path: ~/Library/Developer/Xcode/DerivedData/*/Logs
|
||
|
||
- name: Swift Package Manager - Installation Test
|
||
working-directory: ./
|
||
run: |
|
||
echo 'Current Branch: ' $GITHUB_HEAD_REF
|
||
echo 'Current Revision (SHA):' $GITHUB_SHA
|
||
echo Current Path: $(pwd)
|
||
export PACKAGE_URL=file://$(pwd)
|
||
export PACKAGE_BRANCH_NAME=$GITHUB_HEAD_REF
|
||
export PACKAGE_REVISION=$GITHUB_SHA
|
||
swift test --package-path Examples/SPM -v
|