Skip to content

fix more build errors #2

fix more build errors

fix more build errors #2

on:
workflow_call:
inputs:
wire-ios:
type: boolean
default: false
required: false
wire-ios-sync-engine:
type: boolean
default: false
required: false
wire-ios-data-model:
type: boolean
default: false
required: false
wire-ios-system:
type: boolean
default: false
required: false
wire-ios-request-strategy:
type: boolean
default: false
required: false
wire-api:
type: boolean
default: false
required: false
wire-domain:
type: boolean
default: false
required: false
wire-ios-transport:
type: boolean
default: false
required: false
wire-ios-share-engine:
type: boolean
default: false
required: false
wire-ios-cryptobox:
type: boolean
default: false
required: false
wire-ios-mocktransport:
type: boolean
default: false
required: false
wire-ios-notification-engine:
type: boolean
default: false
required: false
wire-ios-protos:
type: boolean
default: false
required: false
wire-ios-images:
type: boolean
default: false
required: false
wire-ios-link-preview:
type: boolean
default: false
required: false
wire-ios-utilities:
type: boolean
default: false
required: false
wire-ios-testing:
type: boolean
default: false
required: false
all:
type: boolean
default: false
required: false
secrets:
ZENKINS_USERNAME:
required: true
DD_API_KEY:
required: true
env: # https://docs.fastlane.tools/getting-started/ios/setup/
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
jobs:
run-tests:
runs-on: ghcr.io/cirruslabs/macos-runner:sonoma
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ secrets.ZENKINS_USERNAME }}
SLACK_WEBHOOK_URL: ${{ secrets.WIRE_IOS_CI_WEBHOOK }}
steps:
- uses: actions/checkout@v3
- name: Retrieve Xcode version
run: |
echo "XCODE_VERSION=$(cat .xcode-version)" >> $GITHUB_OUTPUT
id: xcode-version
- uses: maxim-lobanov/[email protected]
with:
xcode-version: ${{ steps.xcode-version.outputs.XCODE_VERSION }}
- name: Load .env file
uses: xom9ikk/dotenv@v2
with:
path: fastlane/
- name: Restore Carthage Cache
uses: actions/cache@v3
id: cache-carthage
with:
path: Carthage
key: ${{ runner.os }}-xcode${{ steps.xcode-version.outputs.XCODE_VERSION }}-carthage-${{ hashFiles('Cartfile.resolved') }}
- name: Bootstrap Carthage if no cache
if: steps.cache-carthage.outputs.cache-hit != 'true'
run: ./scripts/carthage.sh bootstrap --platform ios --use-xcframeworks
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup workspace
run: |
./setup.sh
- name: Setup simulator
run: |
bundle exec fastlane prepare_for_tests
- name: Test WireSystem
if: ${{ inputs.wire-ios-system || inputs.all }}
run: |
echo "WireSystem has changes"
echo "Building WireSystem..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireSystem -resultBundlePath xcodebuild-wire-ios-system -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-system.log | bundle exec xcpretty
echo "Testing WireSystem..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireSystem -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-system.log | bundle exec xcpretty --report junit --output build/reports/WireSystem.junit
exit ${PIPESTATUS[0]}
- uses: hoangapvn/analyze-xcoderesults-action
if: ${{ inputs.wire-ios-system || inputs.all }}
with:
results: xcodebuild-wire-ios-system.xcresult
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test WireTesting
if: ${{ inputs.wire-ios-testing || inputs.all }}
run: |
echo "WireTesting has changes"
echo "Building WireTesting..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireTesting -resultBundlePath xcodebuild-wire-ios-testing -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-testing.log | bundle exec xcpretty
echo "Testing WireTesting..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireTesting -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-testing.log | bundle exec xcpretty --report junit --output build/reports/WireTesting.junit
exit ${PIPESTATUS[0]}
- name: Test WireUtilities
if: ${{ inputs.wire-ios-utilities || inputs.all }}
run: |
echo "WireUtilities has changes"
echo "Building WireUtilities..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireUtilities -resultBundlePath xcodebuild-wire-ios-utilities -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-utilities.log | bundle exec xcpretty
echo "Testing WireUtilities..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireUtilities -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-utilities.log | bundle exec xcpretty --report junit --output build/reports/WireUtilities.junit
exit ${PIPESTATUS[0]}
- name: Test WireCryptobox
if: ${{ inputs.wire-ios-cryptobox || inputs.all }}
run: |
echo "WireCryptobox has changes"
echo "Building WireCryptobox..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireCryptobox -resultBundlePath xcodebuild-wire-ios-cryptobox -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-cryptobox.log | bundle exec xcpretty
echo "Testing WireCryptobox..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireCryptobox -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-cryptobox.log | bundle exec xcpretty --report junit --output build/reports/WireCryptobox.junit
exit ${PIPESTATUS[0]}
- name: Test WireTransport
if: ${{ inputs.wire-ios-transport || inputs.all }}
run: |
echo "WireTransport has changes"
echo "Building WireTransport..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireTransport -resultBundlePath xcodebuild-wire-ios-transport -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-transport.log | bundle exec xcpretty
echo "Testing WireTransport..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireTransport -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-transport.log | bundle exec xcpretty --report junit --output build/reports/WireTransport.junit
exit ${PIPESTATUS[0]}
- name: Test WireLinkPreview
if: ${{ inputs.wire-ios-link-preview || inputs.all }}
run: |
echo "WireLinkPreview has changes"
echo "Building WireLinkPreview..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireLinkPreview -resultBundlePath xcodebuild-wire-ios-link-preview -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-link-preview.log | bundle exec xcpretty
echo "Testing WireLinkPreview..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireLinkPreview -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-link-preview.log | bundle exec xcpretty --report junit --output build/reports/WireLinkPreview.junit
exit ${PIPESTATUS[0]}
- name: Test WireImages
if: ${{ inputs.wire-ios-images || inputs.all }}
run: |
echo "WireImages has changes"
echo "Building WireImages..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireImages -resultBundlePath xcodebuild-wire-ios-images -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-images.log | bundle exec xcpretty
echo "Testing WireImages..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireImages -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-images.log | bundle exec xcpretty --report junit --output build/reports/WireImages.junit
exit ${PIPESTATUS[0]}
- name: Test WireProtos
if: ${{ inputs.wire-ios-protos || inputs.all }}
run: |
echo "WireProtos has changes"
echo "Building WireProtos..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireProtos -resultBundlePath xcodebuild-wire-ios-protos -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-protos.log | bundle exec xcpretty
echo "Testing WireProtos..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireProtos -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-protos.log | bundle exec xcpretty
exit ${PIPESTATUS[0]}
- name: Test WireMockTransport
if: ${{ inputs.wire-ios-mocktransport || inputs.all }}
run: |
echo "WireMockTransport has changes"
echo "Building WireMockTransport..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireMockTransport -resultBundlePath xcodebuild-wire-ios-mocktransport -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-mocktransport.log | bundle exec xcpretty
echo "Testing WireMockTransport..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireMockTransport -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-mocktransport.log | bundle exec xcpretty --report junit --output build/reports/WireMockTransport.junit
exit ${PIPESTATUS[0]}
- name: Test WireDataModel
if: ${{ inputs.wire-ios-data-model || inputs.all }}
run: |
echo "WireDataModel has changes"
echo "Building WireDataModel..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireDataModel -resultBundlePath xcodebuild-wire-ios-data-model -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-data-model.log | bundle exec xcpretty
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireDataModel -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-data-model.log | bundle exec xcpretty --report junit --output build/reports/WireDataModel.junit
exit ${PIPESTATUS[0]}
- name: Test WireAPI
if: ${{ inputs.wire-api || inputs.all }}
run: |
echo "WireAPI has changes"
echo "Building WireAPI..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireAPI -resultBundlePath xcodebuild-wire-api -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-api.log | bundle exec xcpretty
echo "Testing WireAPI..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireAPI -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-api.log | bundle exec xcpretty --report junit --output build/reports/WireAPI.junit
exit ${PIPESTATUS[0]}
- name: Test WireDomain
if: ${{ inputs.wire-domain || inputs.all }}
run: |
echo "WireDomain has changes"
echo "Building WireDomain..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireDomain -resultBundlePath xcodebuild-wire-domain -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-domain.log | bundle exec xcpretty
echo "Testing WireDomain..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireDomain -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-domain.log | bundle exec xcpretty --report junit --output build/reports/WireDomain.junit
exit ${PIPESTATUS[0]}
- name: Test WireRequestStrategy
if: ${{ inputs.wire-ios-request-strategy || inputs.all }}
run: |
echo "WireRequestStrategy has changes"
echo "Building WireRequestStrategy..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireRequestStrategy -resultBundlePath xcodebuild-wire-ios-request-strategy -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-request-strategy.log | bundle exec xcpretty
echo "Testing WireRequestStrategy..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireRequestStrategy -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-request-strategy.log | bundle exec xcpretty --report junit --output build/reports/WireRequestStrategy.junit
exit ${PIPESTATUS[0]}
- name: Test WireShareEngine
if: ${{ inputs.wire-ios-share-engine || inputs.all }}
run: |
echo "WireShareEngine has changes"
echo "Building WireShareEngine..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireShareEngine -resultBundlePath xcodebuild-wire-ios-share-engine -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-share-engine.log | bundle exec xcpretty
echo "Testing WireShareEngine..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireShareEngine -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-share-engine.log | bundle exec xcpretty --report junit --output build/reports/WireShareEngine.junit
exit ${PIPESTATUS[0]}
- name: Test WireSyncEngine
if: ${{ inputs.wire-ios-sync-engine || inputs.all }}
run: |
echo "WireSyncEngine has changes"
echo "Building WireSyncEngine..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireSyncEngine -resultBundlePath xcodebuild-wire-ios-sync-engine -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-sync-engine.log | bundle exec xcpretty
echo "Testing WireSyncEngine..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireSyncEngine -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-sync-engine.log | bundle exec xcpretty --report junit --output build/reports/WireSyncEngine.junit
exit ${PIPESTATUS[0]}
- name: Test Wire-iOS
if: ${{ inputs.wire-ios || inputs.all }}
run: |
echo "Wire-iOS has changes"
echo "Building Wire-iOS..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme Wire-iOS -resultBundlePath xcodebuild-wire-ios -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios.log | bundle exec xcpretty
echo "Testing Wire-iOS..."
xcodebuild test -workspace wire-ios-mono.xcworkspace -scheme Wire-iOS -testPlan AllTests -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios.log | bundle exec xcpretty --report junit --output build/reports/Wire-iOS-EN.junit
exit ${PIPESTATUS[0]}
- name: Test Wire-iOS German Locale Tests
if: ${{ inputs.wire-ios || inputs.all }}
run: |
echo "Testing Wire-iOS German Locale Tests..."
xcodebuild test -workspace wire-ios-mono.xcworkspace -scheme Wire-iOS -testPlan GermanLocaleTests -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-de.log | bundle exec xcpretty --report junit --output build/reports/Wire-iOS-DE.junit
exit ${PIPESTATUS[0]}
- name: Upload Failed snapshots
uses: actions/upload-artifact@v3
if: always()
with:
name: Failed Snapshots and log
path: |
wire-ios/SnapshotResults/
xcodebuild*.log
# WORKAROUND: if we test WireNotificationEngine and then Wire-iOS, we'll get an error when trying to build
# Wire-iOS stating that symbols from the notification can't be found. to workaround this, test the notification
# after the Wire-iOS.
- name: Test WireNotificationEngine
if: ${{ inputs.wire-ios-notification-engine || inputs.all }}
run: |
echo "WireNotificationEngine has changes"
echo "Building WireNotificationEngine..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireNotificationEngine -resultBundlePath xcodebuild-wire-ios-notification-engine -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-notification-engine.log | bundle exec xcpretty
echo "Testing WireNotificationEngine..."
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireNotificationEngine -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-notification-engine.log | bundle exec xcpretty --report junit --output build/reports/WireNotificationEngine.junit
exit ${PIPESTATUS[0]}
- name: Upload Test Reports as Artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: test-reports
path: |
build/reports/*.junit
- name: Prepare visual representation of test results
uses: EnricoMi/publish-unit-test-result-action/macos@v2
if: always()
with:
files: |
build/reports/*.junit
compare_to_earlier_commit: false
- name: Archiving DerivedData Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: derived-data-xcode
path: |
/Users/runner/Library/Developer/Xcode/DerivedData/**/Logs/**
~/Library/Logs/DiagnosticReports/**
- name: Notify on Wire if failed
if: ${{ failure() && github.ref_name == 'develop' }}
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: "πŸ†˜ Tests for 'develop' failed πŸ†˜\ncommit: https://github.com/wireapp/wire-ios-mono/commit/${{ github.sha }}\n**Triggered by:** ${{ github.triggering_actor }}\n**Build log:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n"
upload-test-results-datadadog:
runs-on: ubuntu-latest
needs: run-tests
if: always()
steps:
- name: Download tests results
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: test-reports
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install datadog-ci
run: npm install -g @datadog/datadog-ci
- name: "Upload results"
env:
DATADOG_API_KEY: ${{ secrets.DD_API_KEY }}
DD_ENV: ci
DATADOG_SITE: datadoghq.eu
run: |
find . -name "*.junit" -type f | tr '\n' ' ' | xargs -L 1 datadog-ci junit upload --service wire-ios-mono .