mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-15 21:32:26 +01:00
The macOS job named 36 of the recorder's 731 tests by the module paths of its macOS sources. Its tests are platform-neutral by module but worded in cfg!(target_os = "macos") branches (the options of a recording, the keys of the viewer, the frames), so a Linux or Windows run takes the other side of each and only a Mac takes this one, and a filter by name left most of that untested and would go stale with every module. It runs the whole suite now: it compiles the same test binary the filter needed and adds about 30 s of tests. In a depth-1 git checkout, as the runner has, all 731 pass (3 skip by design). The filterset recorder-macos of tools/test-partition is gone with its use. The test window and the agent of the e2e guests (class tool) have macOS sources (AppKit, the accessibility API) that no other job compiles, and the tests of the test window's command line ran nowhere. The job runs their tests and clippy. With the os_sensitive step before it, every class of tools/test-partition that has macOS tests has a run on a Mac: the macOS packages (macos-nextest), os_sensitive, the mixed ones (komorebi-client and komorebi-bar in macos-nextest, the recorder whole) and tool.
80 lines
3.6 KiB
YAML
80 lines
3.6 KiB
YAML
# The macOS jobs, called by ci.yaml on a hosted runner.
|
|
|
|
name: macos
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
runs-on:
|
|
description: The runner, as JSON, for example '"macos-latest"'
|
|
type: string
|
|
required: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
macos:
|
|
runs-on: ${{ fromJSON(inputs.runs-on) }}
|
|
timeout-minutes: 120
|
|
env:
|
|
# a symlinked TMPDIR (/var/folders -> /private/var/folders) breaks a test of the recorder: the
|
|
# cargo steps run in a canonical one
|
|
TMPDIR: /private/tmp/komorebi-ci-${{ github.run_id }}-${{ github.run_attempt }}
|
|
steps:
|
|
- run: mkdir -p "$TMPDIR"
|
|
- uses: actions/checkout@v6
|
|
- uses: ./.github/actions/nix
|
|
with:
|
|
cachix-cache: ${{ vars.CACHIX_CACHE }}
|
|
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
- name: The macOS checks
|
|
run: nix build -L --no-link .#checkSets.macos-lint .#checkSets.macos-test .#checkSets.macos-options
|
|
# the whole test suite of the recorder, in the native shell: the default one exports
|
|
# CARGO_BUILD_TARGET=x86_64-pc-windows-msvc, and nextest cannot list the tests of a Windows .exe on a
|
|
# Mac. Its tests are platform-neutral by module but worded in `cfg!(target_os = "macos")` branches
|
|
# (the options of a recording, the keys of the viewer, the frames), and a Linux or Windows run takes
|
|
# the other side of each: only a Mac takes this one. A filter of the macOS modules selected 36 of the 731
|
|
- name: The recorder's tests
|
|
run: |
|
|
nix develop .#native --command cargo nextest run --locked -p komorebi-recorder
|
|
# the packages whose tests depend on the OS (tools/test-partition.json, class os_sensitive: the wording
|
|
# of the identifiers, the schemas, the pages of the cli) run on each platform they describe, as
|
|
# windows-native-test does on Windows: the checked-in pages of docs/macos/cli are what only a macOS
|
|
# host renders. macos-nextest above runs the macOS packages only
|
|
- name: The OS-sensitive tests
|
|
run: |
|
|
# shellcheck disable=SC2016
|
|
nix develop .#native --command bash -c 'cargo nextest run --locked $(tools/test-partition packages os_sensitive)'
|
|
# the programs of the e2e guests (class `tool`): the test window and the agent have macOS sources
|
|
# (AppKit, the accessibility API) that no other job compiles, and the tests of the test window's
|
|
# command line; clippy sees the sources the tests do not run
|
|
- name: The e2e tools
|
|
run: |
|
|
nix develop .#native --command bash -euo pipefail -c '
|
|
cargo nextest run --locked -p komorebi-testwin -p komorebi-e2e-agent --no-tests=pass
|
|
cargo clippy --locked --all-targets -p komorebi-testwin -p komorebi-e2e-agent -- -D warnings
|
|
'
|
|
- name: The binaries
|
|
run: |
|
|
nix build -L --no-link --print-out-paths .#komorebi .#komorebic .#komorebi-bar |
|
|
while read -r out; do
|
|
for bin in "$out"/bin/*; do "$bin" --version; done
|
|
done
|
|
- name: The schemas are current
|
|
run: |
|
|
nix develop --command just jsonschema
|
|
git diff --exit-code schemas/macos
|
|
- name: Logs of a failed run
|
|
if: failure()
|
|
run: |
|
|
mkdir -p "$RUNNER_TEMP/logs"
|
|
cp -R "$TMPDIR"/. "$RUNNER_TEMP/logs/" 2>/dev/null || true
|
|
- if: failure()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ci-macos-logs-${{ github.run_id }}-${{ github.run_attempt }}
|
|
path: ${{ runner.temp }}/logs
|
|
if-no-files-found: ignore
|
|
retention-days: 7
|