Files
element-x-ios/.github/workflows/compound-ios.yml
T

81 lines
3.1 KiB
YAML

# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
name: Compound
on:
workflow_dispatch:
push:
branches: [develop]
paths:
- "compound-ios/**"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "compound-ios/**"
permissions: {}
jobs:
tests:
# HealthChat: skip in this fork. It only triggers on changes under compound-ios/, which this fork
# has never edited, so it would only ever fire on an upstream sync and go red at checkout —
# permissions: {} leaves a metadata-only token that cannot read an INTERNAL repo. Gated rather
# than deleted so the file keeps rebasing cleanly.
if: github.repository == 'element-hq/element-x-ios'
runs-on: xcode-27
timeout-minutes: 25
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: ${{ github.ref == 'refs/heads/develop' && format('compound-develop-{0}', github.sha) || format('compound-{0}', github.ref) }}
cancel-in-progress: true
steps:
- uses: nschloe/action-cached-lfs-checkout@385a8ecc719e50b8c71af6ab01a624b486b7c3bc # v1.2.5
with:
persist-credentials: false
- name: Configure Xcode 27
run: sudo xcode-select -s /Applications/Xcode_27.app
- name: Install sourcery
run: brew install sourcery
- name: Generate preview tests
working-directory: compound-ios
run: sourcery --config Tools/Sourcery/PreviewTestsConfig.yml
- name: Create simulator
run: xcrun simctl create "Snapshots" "iPhone SE (3rd generation)" "com.apple.CoreSimulator.SimRuntime.iOS-27-0"
- name: Run tests
working-directory: compound-ios
run: set -o pipefail && xcodebuild test -scheme 'Compound' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=Snapshots,OS=27.0' -skipPackagePluginValidation -resultBundlePath Logs/CompoundTests.xcresult | xcbeautify --renderer github-actions
- name: Zip artifacts
if: failure() # We only care about artefacts if the tests fail
working-directory: compound-ios
run: zip -r Logs/CompoundTests.xcresult.zip Logs/CompoundTests.xcresult/
- name: Archive artifacts
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: failure() # We only care about artefacts if the tests fail
with:
name: test-results
path: compound-ios/Logs/CompoundTests.xcresult.zip
retention-days: 1
if-no-files-found: ignore
- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
xcode: true
xcode_archive_path: compound-ios/Logs/CompoundTests.xcresult
flags: compound