-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (59 loc) · 1.98 KB
/
build-test-python.yml
File metadata and controls
66 lines (59 loc) · 1.98 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
# This workflow builds the package, installs it, and tests basic functionality
name: Build and Test Python Package
on:
pull_request:
branches: ["main"]
push:
branches: ["main"]
env:
PYTHON_VERSION: "3.10"
jobs:
test-build-package-extras:
name: Test package build ${{ matrix.name}}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
include:
- name: cli
test-args: "twyn --version"
- name: mcp
test-args: |
cat <<EOF > init_msg.json
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}
EOF
cat init_msg.json | uv run python src/twyn/mcp/main.py | grep -q "capabilities"
steps:
- name: Check out the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build package
uses: ./.github/actions/python-package-build
id: build
with:
uv-version: "0.8.22"
python-version: "$PYTHON_VERSION"
- name: Test package
run: |
uv venv --python $PYTHON_VERSION
uv pip install "${{ steps.build.outputs.wheel-file }}[${{ matrix.name }}]"
uv run ${{ matrix.test-args }}
test-build-package:
name: Test package build no extras
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build package
uses: ./.github/actions/python-package-build
id: build
with:
uv-version: "0.8.22"
python-version: "$PYTHON_VERSION"
- name: Test package
run: |
uv venv --python $PYTHON_VERSION
uv pip install "${{ steps.build.outputs.wheel-file }}"
uv run python -c 'import twyn; twyn.check_dependencies()'