-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (134 loc) · 5.69 KB
/
Copy pathci.yml
File metadata and controls
142 lines (134 loc) · 5.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: CI
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.repository }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-and-test:
if: ${{ github.event_name != 'pull_request' || (!github.event.pull_request.draft && github.event.action != 'closed') }}
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- name: Verify exact checkout
env:
INKSPAN_EXPECTED_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
actual_head="$(git rev-parse HEAD)"
test "$actual_head" = "$INKSPAN_EXPECTED_HEAD_SHA"
# pnpm version comes from the package.json "packageManager" field
# (pnpm 10+), which is required to read `overrides` from
# pnpm-workspace.yaml consistently with the committed lockfile.
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Typecheck
run: pnpm typecheck
- name: Test with 100% coverage
run: pnpm coverage
- name: Build library
run: pnpm build
- name: Verify packed package consumers
run: pnpm verify:package
- name: Build demo
run: pnpm build:demo
browser-release-evidence:
if: ${{ github.event_name != 'pull_request' || (!github.event.pull_request.draft && github.event.action != 'closed') }}
name: Cross-engine Clipboard / Playwright 1.62.0
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
PLAYWRIGHT_BROWSERS_PATH: /tmp/inkspan-playwright-browsers
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- name: Verify exact checkout
env:
INKSPAN_EXPECTED_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
actual_head="$(git rev-parse HEAD)"
test "$actual_head" = "$INKSPAN_EXPECTED_HEAD_SHA"
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
cache: pnpm
- name: Install root dependencies from the immutable lock
run: pnpm install --frozen-lockfile
- name: Install browser-test dependencies from the isolated immutable lock
run: pnpm --dir tests/browser install --frozen-lockfile
- name: Install Playwright browser revisions pinned by 1.62.0
run: pnpm --dir tests/browser exec playwright install --with-deps chromium firefox webkit
- name: Verify real-engine rich clipboard release evidence
env:
INKSPAN_EXPECTED_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: pnpm --dir tests/browser exec playwright test --config playwright.config.ts
office:
if: ${{ github.event_name != 'pull_request' || (!github.event.pull_request.draft && github.event.action != 'closed') }}
name: Office / Python ${{ matrix.python-version }}
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ${{ github.event_name == 'pull_request' && fromJSON('["3.14"]') || fromJSON('["3.11", "3.12", "3.13", "3.14"]') }}
defaults:
run:
working-directory: office
env:
PYTHONPATH: src
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- name: Verify exact checkout
env:
INKSPAN_EXPECTED_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
actual_head="$(git rev-parse HEAD)"
test "$actual_head" = "$INKSPAN_EXPECTED_HEAD_SHA"
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: office/requirements-ci.txt
- name: Install hash-locked dependencies
run: "python -m pip install --require-hashes --only-binary=:all: -r requirements-ci.txt"
- name: Verify dependency consistency
run: python -m pip check
- name: Verify 100% docstring coverage
run: python scripts/check_docstrings.py
- name: Test with 100% branch coverage
run: |
coverage run -m pytest
coverage report
- name: Build wheel
run: python -m pip wheel . --no-deps --no-build-isolation --wheel-dir dist
- name: Verify packaged schema and license
run: |
python - <<'PY'
from pathlib import Path
from zipfile import ZipFile
wheel = next(Path("dist").glob("*.whl"))
with ZipFile(wheel) as archive:
names = set(archive.namelist())
assert "inkspan_office/schema.json" in names
assert any(name.endswith(".dist-info/licenses/LICENSE") for name in names)
PY