Files
OrcaSlicer/.github/workflows/unit_tests.yml
Lam Wei Lun 7bd399865b macOS: build, sign and publish the Sparkle appcast (#18145)
Add the macOS Sparkle build, signing and appcast

Pin Sparkle 2.9.6 in the deps, write the feed URL and the EdDSA public key into the bundle, sign the framework's helpers before the app, and generate and publish the signed appcast from the DMGs that CI builds.
2026-12-04 18:01:11 +08:00

101 lines
3.9 KiB
YAML

name: Unit Tests
# Download a platform's test artifact, run ctest, and upload the JUnit
# results for aggregation. Called once per arch from build_all.yml.
on:
workflow_call:
inputs:
os:
required: true
type: string
artifact:
description: Test artifact uploaded by the build leg
required: true
type: string
test-dir:
description: Built tests dir; defaults to build/tests, override for arch-separated builds
required: false
type: string
default: build/tests
jobs:
unit_tests:
# Static "Unit Tests"; the per-arch label is the caller's job name, so the
# graph shows e.g. "Windows x64 / Unit Tests".
name: Unit Tests
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
# Tests reach outside tests/ at runtime: tests/data (TEST_DATA_DIR) and
# resources/profiles (PROFILES_DIR) by baked-in absolute path, plus
# resources/info (nozzle data) via resources_dir() during a real slice.
# Check out all of resources/ so no test hits a missing-file path.
# deps/ is the Sparkle pin tests/appcast reads (deps/deps-macos.cmake); without
# it that test skips, and a skipped test is a green job that checked nothing.
sparse-checkout: |
.github
scripts
tests
resources
deps
- name: Apt-Install Dependencies
if: runner.os == 'Linux' && !vars.SELF_HOSTED
uses: ./.github/actions/apt-install-deps
- name: Restore Test Artifact
uses: actions/download-artifact@v8
with:
name: ${{ inputs.artifact }}
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~4.3.0" # use most recent 4.3.x version
useLocalCache: true
useCloudCache: true
# Skips self-hosted runners, where this machine-wide setting would stay after the job ends.
- name: Enable Crash Dumps
if: runner.os == 'Windows' && !vars.SELF_HOSTED
shell: pwsh
run: |
$key = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps'
New-Item -Path $key -Force | Out-Null
New-ItemProperty -Path $key -Name DumpFolder -PropertyType ExpandString -Value "$env:RUNNER_TEMP\crash-dumps" -Force | Out-Null
New-ItemProperty -Path $key -Name DumpType -PropertyType DWord -Value 2 -Force | Out-Null
New-ItemProperty -Path $key -Name DumpCount -PropertyType DWord -Value 5 -Force | Out-Null
- name: Unpackage and Run Unit Tests
timeout-minutes: 20
shell: bash
run: |
tar -xf build_tests.tar
# Every platform builds with a multi-config generator (build_linux.sh uses Ninja
# Multi-Config), so ctest needs the config: without it, plain add_test() tests
# lose their labels and report "Not Run".
scripts/run_unit_tests.sh "${{ inputs.test-dir }}" Release
- name: Upload Test Logs
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: unit-test-logs-${{ inputs.artifact }}
path: ${{ inputs.test-dir }}/**/*.log
- name: Upload Crash Dumps
if: ${{ failure() && runner.os == 'Windows' && !vars.SELF_HOSTED }}
uses: actions/upload-artifact@v7
with:
name: crash-dumps-${{ inputs.artifact }}
path: ${{ runner.temp }}/crash-dumps
retention-days: 5
if-no-files-found: ignore
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-${{ inputs.artifact }}
path: ctest_results.xml
retention-days: 5
if-no-files-found: warn
- name: Delete Test Artifact
if: success()
uses: geekyeggo/delete-artifact@v6
with:
name: ${{ inputs.artifact }}