Skip to content

ci(release): release from tags through release.yml #4213

ci(release): release from tags through release.yml

ci(release): release from tags through release.yml #4213

Workflow file for this run

name: macOS Tests
on:
pull_request:
push:
branches: [main, 'release/**']
workflow_dispatch:
# A pull request keeps only its newest run. Each pushed commit gets a group of its own, so no push
# run is cancelled or replaced by the next merge; runs wait for a free runner instead.
concurrency:
group: macos-tests-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
changes:
name: Changes (macOS)
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
run: ${{ steps.decide.outputs.run }}
plugins: ${{ steps.decide.outputs.plugins }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Decide which suites run
id: decide
env:
BASE: ${{ github.event.pull_request.base.sha || github.event.before }}
run: |
set -euo pipefail
run=$(scripts/ci/detect-changed-paths.sh --base "$BASE" macos)
plugins=$(scripts/ci/detect-changed-paths.sh --base "$BASE" plugins)
{ echo "run=$run"; echo "plugins=$plugins"; } >> "$GITHUB_OUTPUT"
# The required check. A job skipped by its if: reports success, so no gate job is needed. The
# condition reads "not false" so a failed changes job runs the suite instead of passing it.
macos:
name: macOS Tests
needs: changes
if: ${{ !cancelled() && needs.changes.outputs.run != 'false' }}
runs-on: xcode-27
timeout-minutes: 120
env:
NSUnbufferedIO: "YES"
COMPILE_PLUGINS: ${{ github.event_name != 'pull_request' || needs.changes.outputs.plugins != 'false' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup-xcode
- uses: ./.github/actions/setup-xcodegen
- name: Download static libraries
env:
GH_TOKEN: ${{ github.token }}
run: scripts/download-libs.sh
- name: Generate the Xcode project
run: scripts/generate-project.sh macos
# Saved on a push only: a cache saved on a pull request ref is visible to that PR alone.
- name: Restore Swift package checkouts
id: spm
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.spm-cache
key: spm-${{ runner.os }}-${{ hashFiles('TablePro.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
restore-keys: spm-${{ runner.os }}-
- name: Resolve Swift packages
run: |
xcodebuild -resolvePackageDependencies \
-project TablePro.xcodeproj -scheme TablePro \
-clonedSourcePackagesDirPath ~/.spm-cache -skipPackagePluginValidation
- name: Save Swift package checkouts
if: github.event_name == 'push' && steps.spm.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.spm-cache
key: ${{ steps.spm.outputs.cache-primary-key }}
# One build covers both test plans: build-for-testing writes an .xctestrun per plan.
- name: Build for testing
id: build
run: |
set -o pipefail
xcodebuild build-for-testing \
-project TablePro.xcodeproj -scheme TablePro \
-destination platform=macOS -derivedDataPath DerivedData \
-clonedSourcePackagesDirPath ~/.spm-cache -skipPackagePluginValidation \
-resultBundlePath Build.xcresult \
CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO COMPILATION_CACHE_ENABLE_CACHING=NO \
| xcbeautify --renderer github-actions
# The TablePro scheme builds only the bundled plugins. AllPlugins also compiles the
# registry-only drivers, so every push runs it.
- name: Set up Go for the SAP HANA helper
if: ${{ !cancelled() && env.COMPILE_PLUGINS == 'true' }}
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: Native/HanaBridge/go.mod
cache: false
# The Dameng and HANA targets copy these artifacts in and never build them.
- name: Build the native bridges
id: bridges
if: ${{ !cancelled() && env.COMPILE_PLUGINS == 'true' }}
run: |
scripts/build-dameng.sh arm64
scripts/build-hana.sh arm64
- name: Compile every plugin
if: ${{ !cancelled() && steps.bridges.outcome == 'success' }}
run: |
set -o pipefail
xcodebuild build \
-project TablePro.xcodeproj -scheme AllPlugins \
-destination platform=macOS -derivedDataPath DerivedData \
-clonedSourcePackagesDirPath ~/.spm-cache -skipPackagePluginValidation \
CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO COMPILATION_CACHE_ENABLE_CACHING=NO \
| xcbeautify --renderer github-actions
scripts/ci/verify-plugin-loads.sh DerivedData/Build/Products/Debug
- name: Run the Unit test plan
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
set -o pipefail
xcodebuild test-without-building \
-project TablePro.xcodeproj -scheme TablePro -testPlan Unit \
-destination platform=macOS -derivedDataPath DerivedData \
-clonedSourcePackagesDirPath ~/.spm-cache -skipPackagePluginValidation \
-resultBundlePath Unit.xcresult \
| xcbeautify --renderer github-actions
# Runs even after a unit failure, so one round trip reports both plans.
- name: Run the UI test plan
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
set -o pipefail
xcodebuild test-without-building \
-project TablePro.xcodeproj -scheme TablePro -testPlan UI \
-destination platform=macOS -derivedDataPath DerivedData \
-clonedSourcePackagesDirPath ~/.spm-cache -skipPackagePluginValidation \
-resultBundlePath UI.xcresult \
| xcbeautify --renderer github-actions
# Fails the job when a test bundle ran zero tests, which xcodebuild reports as success.
- name: Summarize the results
if: ${{ !cancelled() }}
run: scripts/ci/summarize-xcresult.sh Build.xcresult Unit.xcresult UI.xcresult
# XCTest attaches nothing when it cannot match a crash of the app under test to a report.
- name: Collect app diagnostics
if: ${{ failure() }}
continue-on-error: true
run: |
mkdir -p app-diagnostics
for dir in "$HOME/Library/Logs/DiagnosticReports" /Library/Logs/DiagnosticReports; do
[ -d "$dir" ] || continue
find "$dir" -maxdepth 2 -iname '*TablePro*' -exec cp {} app-diagnostics/ \;
done
log show --last 2h --style compact --info --predicate 'process == "TablePro"' \
| gzip > app-diagnostics/tablepro-unified.log.gz || true
- name: Upload the evidence
if: ${{ failure() }}
continue-on-error: true
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: macos-tests-${{ github.run_attempt }}
path: |
*.xcresult
app-diagnostics
if-no-files-found: ignore
retention-days: 7