okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-ci-green-0215: the four red GitHub checks (cmake-cpu on MSVC, py-tools on a CRLF checkout and on macOS, the Windows snapshot time)b749503db

main
3.1 KiB91 linesraw
1name: Config snapshot
2
3# tests/snapshot: what `strata launch`, the app's plain Load and the app's Models-screen Load hand the engine (arguments, environment, drafter,
4# confidence), for every simulated machine class and model set, against the golden files in tests/snapshot/golden.  Nothing is loaded,
5# downloaded or run on a GPU.  Windows and Linux must give byte-identical output, so both run.  A change that moves what users
6# get has to update the golden files in the same commit (STRATA_SNAPSHOT_UPDATE=1 python -m pytest tests/snapshot, see tests/snapshot/README.md).
7
8on:
9  push:
10    branches: [main]
11    paths:
12      - .github/workflows/snapshot.yml
13      - tests/snapshot/**
14      - serve/**
15      - strata_cli/**
16      - strata_control/**
17      - setup.py
18      - strata.py
19      - requirements*.txt
20      - apps/host/server/**
21      - apps/host/package*.json
22      - packaging/**
23      - tools/check
24  pull_request:
25    paths:
26      - .github/workflows/snapshot.yml
27      - tests/snapshot/**
28      - serve/**
29      - strata_cli/**
30      - strata_control/**
31      - setup.py
32      - strata.py
33      - requirements*.txt
34      - apps/host/server/**
35      - apps/host/package*.json
36      - packaging/**
37      - tools/check
38  workflow_dispatch:
39
40permissions:
41  contents: read
42
43concurrency:
44  group: snapshot-${{ github.ref }}
45  cancel-in-progress: true
46
47jobs:
48  snapshot:
49    name: ${{ matrix.os }}
50    runs-on: ${{ matrix.os }}
51    timeout-minutes: 45
52    strategy:
53      fail-fast: false
54      matrix:
55        os: [ubuntu-24.04, windows-2022]
56        # GitHub's Windows runner runs this suite about 5x slower than a desktop PC (many small files and Node starts): since 0.2.14 (51 tests,
57        # about 1,000 simulated launches) it reached test 43-45 of 51 in tools/check's 900 s (runs 43742804362, 43754922177), while the owner PC
58        # runs all 51 in 3m20s and Linux CI in 4m25s.  Twice the step's time there; Linux keeps 900 s.
59        include:
60          - os: ubuntu-24.04
61            timeout_scale: 1
62          - os: windows-2022
63            timeout_scale: 2
64    steps:
65      - uses: actions/checkout@v4
66        with:
67          persist-credentials: false
68      - uses: actions/setup-python@v5
69        with:
70          python-version: '3.12'
71          cache: pip
72          cache-dependency-path: requirements*.txt
73      - uses: actions/setup-node@v4
74        with:
75          node-version: '24'
76          cache: npm
77          cache-dependency-path: apps/host/package-lock.json
78      - name: Python packages
79        run: python -m pip install -r requirements.txt -r requirements-dev.txt
80      - name: Host packages (the app's Load runs in Node)
81        working-directory: apps/host
82        run: npm ci --no-audit --no-fund
83      - name: tools/check snapshot
84        run: python tools/check --only snapshot --keep --scratch "${{ runner.temp }}/check" --timeout-scale ${{ matrix.timeout_scale }}
85      - name: Logs
86        if: ${{ failure() }}
87        uses: actions/upload-artifact@v4
88        with:
89          name: snapshot-${{ matrix.os }}
90          path: ${{ runner.temp }}/check/*.log
91          retention-days: 7