-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (96 loc) · 3.84 KB
/
Copy pathchecks.yml
File metadata and controls
119 lines (96 loc) · 3.84 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
name: Checks
on:
push:
branches: ['**']
pull_request:
permissions:
contents: read
concurrency:
group: checks-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.14']
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install development dependencies
run: python -m pip install -e '.[dev]'
- name: Check
run: make check
package:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: '3.14'
cache: pip
- name: Install development dependencies
run: python -m pip install -e '.[dev]'
- name: Build and validate distributions
run: |
python -m build
python -m twine check dist/*
- name: Verify source distribution contents
run: |
tar -tzf dist/featurevisor-*.tar.gz | grep '/conformance/sdk-v3.json$'
tar -tzf dist/featurevisor-*.tar.gz | grep '/tests/test_sdk.py$'
tar -tzf dist/featurevisor-*.tar.gz | grep '/tests_openfeature/test_provider.py$'
- name: Verify base wheel installation
run: |
python -m venv /tmp/featurevisor-base
/tmp/featurevisor-base/bin/python -m pip install --no-deps dist/featurevisor-*.whl
/tmp/featurevisor-base/bin/python -c 'import featurevisor; assert featurevisor.__all__ == ["Featurevisor", "FeaturevisorChildInstance", "FeaturevisorModule", "create_featurevisor"]'
/tmp/featurevisor-base/bin/python -c 'from importlib.util import find_spec; assert find_spec("openfeature") is None'
/tmp/featurevisor-base/bin/python -c 'from pathlib import Path; import featurevisor; assert Path(featurevisor.__file__).with_name("py.typed").is_file()'
/tmp/featurevisor-base/bin/python - <<'PY'
try:
import featurevisor.openfeature
except ModuleNotFoundError as exc:
assert "featurevisor[openfeature]" in str(exc)
else:
raise AssertionError("OpenFeature import unexpectedly succeeded without its optional dependency")
PY
/tmp/featurevisor-base/bin/python -m unittest discover -s tests -v
/tmp/featurevisor-base/bin/python -m pip check
- name: Verify OpenFeature wheel installation
run: |
python -m venv /tmp/featurevisor-openfeature
WHEEL=$(find dist -name 'featurevisor-*.whl' -print -quit)
/tmp/featurevisor-openfeature/bin/python -m pip install "${WHEEL}[openfeature]"
/tmp/featurevisor-openfeature/bin/python -m unittest discover -s tests_openfeature -v
/tmp/featurevisor-openfeature/bin/python -m pip check
example-project:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: '3.14'
cache: pip
- uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
- name: Install Python SDK
run: python -m pip install -e .
- name: Set up Featurevisor v3 example-1 project
run: |
mkdir example-1
(cd example-1 && npx --yes @featurevisor/cli@3.x init --example=1)
(cd example-1 && npm install)
(cd example-1 && npx featurevisor build)
(cd example-1 && npx featurevisor test)
- name: Run project tests against Python SDK
run: python -m featurevisor test --projectDirectoryPath=./example-1 --onlyFailures