Skip to content

Update actions/upload-artifact action to v4 #26

Update actions/upload-artifact action to v4

Update actions/upload-artifact action to v4 #26

Workflow file for this run

name: Demo app
on:
pull_request:
paths:
- .github/workflows/demo.yml
- DemoApp/*
concurrency:
group: ${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
xcode-version:
name: Extract latest Xcode version from matrix
runs-on: ubuntu-latest
outputs:
latest-xcode-version: ${{ steps.extract-xcode-version.outputs.latest_xcode_version }}
steps:
- uses: actions/checkout@v4
- id: extract-xcode-version
run: |
latest_xcode_version=$(cat .github/matrix.json | jq -r '.xcode_version | max')
echo "latest_xcode_version=$latest_xcode_version" >> $GITHUB_OUTPUT
test:
name: Test
needs: xcode-version
runs-on: macOS-13
strategy:
fail-fast: false
matrix:
destination:
- 'platform=macOS'
- 'platform=iOS Simulator,name=iPhone 14 Pro'
env:
DEVELOPER_DIR: /Applications/Xcode_${{ needs.xcode-version.outputs.latest-xcode-version }}.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- name: Run Test
id: test
run: |
platform=$(echo '${{ matrix.destination }}' | sed -E 's/platform=(.*)(,name=.*)/\1/g' | tr ' ' '_')
echo "platform=$platform" >> $GITHUB_OUTPUT
defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
cd DemoApp/MockUserDefaultsDemoLib
xcrun xcodebuild \
-scheme 'MockUserDefaultsDemoLib' \
-destination '${{ matrix.destination }}' \
-resultBundlePath "test_output/$platform.xcresult" \
test | xcpretty
- name: Upload test result
uses: actions/upload-artifact@v4
with:
name: ${{ steps.test.outputs.platform }}
path: DemoApp/MockUserDefaultsDemoLib/test_output
if-no-files-found: error
retention-days: 7