chore: add testing workflow #14
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
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
name: test | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pkl | |
run: | | |
curl -L -o pkl 'https://github.com/apple/pkl/releases/download/0.26.3/pkl-macos-aarch64' | |
chmod +x pkl | |
sudo mv pkl /usr/local/bin/pkl | |
pkl --version | |
- name: Select xcode version | |
run: sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer | |
- uses: actions/cache@v4 | |
with: | |
path: ~/Library/Developer/Xcode/DerivedData/Cosmic-*/SourcePackages/ | |
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | |
save-always: true | |
- name: Execute build | |
run: xcodebuild build -scheme "$SCHEME" -destination "$DESTINATION" CODE_SIGNING_ALLOWED='NO' | xcpretty && exit ${PIPESTATUS[0]} | |
env: | |
DESTINATION: platform=macOS,arch=arm64 | |
SCHEME: Cosmic | |
- name: Execute test | |
run: xcodebuild test -resultBundlePath TestResults -scheme "$SCHEME" -destination "$DESTINATION" CODE_SIGNING_ALLOWED='NO' | xcpretty && exit ${PIPESTATUS[0]} | |
env: | |
DESTINATION: platform=macOS,arch=arm64 | |
SCHEME: CosmicTests | |
- name: Archive test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: TestResults | |
path: TestResults.xcresult/ | |
if: success() || failure() | |
- uses: kishikawakatsumi/xcresulttool@v1 | |
with: | |
path: TestResults.xcresult | |
if: success() || failure() |