* Add zizmor checks on CI. * Fix zizmor credentials warnings * Add persist-credentials: false to action-cached-lfs-checkout too. * Add empty permissions by default. * Ignore pull_request_target failure and add a warning.
78 lines
2.6 KiB
YAML
78 lines
2.6 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:
|
|
|
|
runs-on: macos-26
|
|
timeout-minutes: 15
|
|
|
|
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@f46300cd8952454b9f0a21a3d133d4bd5684cfc2 #v1.2.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Configure Xcode 26
|
|
run: sudo xcode-select -s /Applications/Xcode_26.1.1.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-26-1"
|
|
|
|
- name: Run tests
|
|
working-directory: compound-ios
|
|
run: set -o pipefail && xcodebuild test -scheme 'Compound' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=Snapshots,OS=26.1' -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@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
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@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
|
|
with:
|
|
fail_ci_if_error: false
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
xcode: true
|
|
xcode_archive_path: compound-ios/Logs/CompoundTests.xcresult
|
|
flags: compound
|
|
|