81 lines
3.0 KiB
YAML
81 lines
3.0 KiB
YAML
name: tests-macos
|
|
|
|
# Separate from tests.yml on purpose. This runs on a laptop, and a laptop is
|
|
# sometimes asleep. Keeping it in its own workflow means a queued macOS job
|
|
# leaves *this* run pending instead of holding the main test result hostage.
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: tests-macos-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
macos:
|
|
# Homebrew act_runner executes jobs directly on the host — there is no
|
|
# container.
|
|
#
|
|
# Cased exactly as the runner declared it. Gitea compares runs-on against
|
|
# the registered label string, and rather than depend on that comparison
|
|
# being case-insensitive, matching the declaration is guaranteed either way.
|
|
# The runner also carries Apple-Silicon if a job ever needs to be specific
|
|
# about the architecture rather than the OS.
|
|
runs-on: MacOS-Latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# No setup-python / setup-node here, deliberately. Those actions install
|
|
# a toolchain into a container that does not exist in host mode. Using
|
|
# whatever Homebrew provides is also the better test: it is the
|
|
# environment an actual macOS user would have, rather than a pinned one
|
|
# nobody runs.
|
|
- name: Show toolchain
|
|
run: |
|
|
python3 --version
|
|
node --version
|
|
npm --version
|
|
uname -m
|
|
|
|
# A venv rather than --user: Homebrew's Python is externally managed
|
|
# (PEP 668), so a plain pip install into it is refused outright.
|
|
- name: Install Python dependencies
|
|
run: |
|
|
python3 -m venv .ci-venv
|
|
.ci-venv/bin/python -m pip install --quiet --upgrade pip
|
|
.ci-venv/bin/python -m pip install -r requirements-ci.txt
|
|
|
|
# requirements-ci.txt omits llama-cpp-python, so this covers suite
|
|
# loading, grading, reporting and the HTTP surface — not inference.
|
|
# Exercising .apple_silicon needs model weights CI does not have, and
|
|
# remains a manual check.
|
|
- name: Run Python tests
|
|
run: .ci-venv/bin/python tests_py/run_all.py
|
|
|
|
- name: Install web dependencies
|
|
working-directory: web
|
|
run: npm ci
|
|
|
|
- name: Type-check and build
|
|
working-directory: web
|
|
run: npm run build
|
|
|
|
- name: Run UI tests
|
|
working-directory: web
|
|
run: npm test
|
|
|
|
# Proves the shipped artifact actually works on macOS, which is a
|
|
# different claim from "it built". Catches launcher and layout problems
|
|
# that never show up in a source checkout.
|
|
- name: Smoke-test the packaged archive
|
|
run: |
|
|
.ci-venv/bin/python packaging/build.py --platform macos --skip-web
|
|
cd dist
|
|
tar xzf LM-Gambit-*-macos.tar.gz
|
|
cd LM-Gambit-*-macos
|
|
test -x LM-Gambit.sh || { echo "launcher is not executable"; exit 1; }
|
|
head -1 LM-Gambit.sh | grep -q '^#!/usr/bin/env bash$' || { echo "bad shebang"; exit 1; }
|
|
../../.ci-venv/bin/python auto-test.py --suites
|