Skip to content

add unit test

add unit test #9

Workflow file for this run

name: CI
on:
pull_request:
branches: [master]
workflow_dispatch:
jobs:
name: Build and Test

Check failure on line 9 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 9
build:
runs-on: macos-latest
strategy:
matrix:
build-config:
- {
scheme: "Cache-iOS",
destination: "platform=iOS Simulator,name=iPhone 15",
sdk: "iphonesimulator",
}
- {
scheme: "Cache-tvOS",
destination: "platform=tvOS Simulator,name=Apple TV",
sdk: "appletvsimulator",
}
- {
scheme: "Cache-watchOS",
destination: "platform=watchOS Simulator",
sdk: "watchsimulator",
}
- {
scheme: "Cache-macOS",
destination: "platform=generic/platform=macOS",
sdk: "macosx",
}
steps:
- uses: actions/checkout@v4
- name: Build
run: |
xcodebuild clean build \
-project 'Cache.xcodeproj' \
-scheme '${{ matrix.build-config['scheme'] }}' \
-sdk '${{ matrix.build-config['sdk'] }}' \
-destination '${{ matrix.build-config['destination'] }}'
- name: Unit "Cache-iOS-Tests"
run: |
if [ "${{ matrix.build-config['scheme'] }}" == "Cache-watchOS" ]; then
echo "A string é igual a Cache-watchOS"
exit 0;
fi
xcodebuild test \
-project 'Cache.xcodeproj' \
-scheme '${{ matrix.build-config['scheme'] }}-Tests' \
-sdk '${{ matrix.build-config['sdk'] }}' \
-destination '${{ matrix.build-config['destination'] }}'