Repository navigation
60 lines (56 loc) · 2.05 KB
/
Copy pathtests.yml
File metadata and controls
60 lines (56 loc) · 2.05 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
name: Python tests
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: python-tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Fetch pinned shared fixture release tag
run: |
tag=$(python -c 'import json; print(json.load(open("tests/fixtures-pin.json"))["tag"])')
git -C references/fixtures-ooxml fetch --no-tags origin "refs/tags/${tag}:refs/tags/${tag}"
- name: Install project and tests
run: python -m pip install '.[dev]'
- name: Record resolved environment
run: |
mkdir -p test-results
python --version > test-results/python.txt
python -m pip freeze > test-results/dependencies.txt
- name: Run one sequential test batch
run: bash tests/run_tests.sh tests/ -q -o addopts='' --junitxml=test-results/pytest.xml
- name: Verify wheel-backed MCP workflows
run: |
python -m pip wheel . --no-deps --wheel-dir dist
python -m venv .wheel-venv
.wheel-venv/bin/python -m pip install dist/*.whl
OFFICE_MCP_TEST_PYTHON="$PWD/.wheel-venv/bin/python" bash tests/run_tests.sh tests/test_stdio_mutation_workflows.py tests/test_office_http.py -q -o addopts='' --junitxml=test-results/wheel.xml
- name: Check tracked files were not changed by verification
if: always()
run: git diff --exit-code
- name: Upload test evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: pytest-${{ matrix.python-version }}
path: test-results/
retention-days: 7