Repository navigation
186 lines (180 loc) · 7.29 KB
/
Copy pathtest.yml
File metadata and controls
186 lines (180 loc) · 7.29 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
package:
name: Build and install distribution (Python ${{ matrix.python-version }})
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.11", "3.13"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Build source and wheel distributions
run: |
python -m pip install build
python -m build
- name: Install wheel into a clean environment and exercise packaged API
run: |
python -m venv "$RUNNER_TEMP/package-install"
"$RUNNER_TEMP/package-install/bin/python" -m pip install dist/*.whl
cd "$RUNNER_TEMP"
"$RUNNER_TEMP/package-install/bin/python" -I - <<'PY'
import importlib.metadata
import pathlib
import sys
import determa.state
from determa.state import RuntimeProviderRegistry, SourceClosure, load_bundle
assert importlib.metadata.version("determa-state") == "0.3.0"
assert pathlib.Path(determa.state.__file__).is_relative_to(sys.prefix)
bundle = load_bundle("format: 1\nnamespace: package.smoke\nevents: {}\nmachines:\n - machine_id: smoke\n root: {type: simple}\n")
assert bundle.fingerprint.startswith("sha256:")
assert RuntimeProviderRegistry is not None and SourceClosure is not None
PY
"$RUNNER_TEMP/package-install/bin/determa-state" --version
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check out pinned conformance suite
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: fruwehq/determa-state-conformance
ref: c6949440f5b9fd6e06ea5571f4e01681dd59ee04
path: .pinned/determa-state-conformance
- name: Check out pinned specification
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: fruwehq/determa-state-spec
ref: 77c0a2e60cd0771a6d44ae170a079ddd51d7d9f0
path: .pinned/determa-state-spec
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
cache: pip
- name: Install
run: pip install -e '.[dev]'
- name: Ruff
run: ruff check .
- name: Ruff format
run: ruff format --check .
- name: Mypy
run: mypy src/determa
- name: Unit tests
env:
DETERMA_CONFORMANCE_DIR: ${{ github.workspace }}/.pinned/determa-state-conformance
DETERMA_SPEC_DIR: ${{ github.workspace }}/.pinned/determa-state-spec
run: pytest -q
python-311-compatibility:
name: Python 3.11 compatibility
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check out pinned conformance suite
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: fruwehq/determa-state-conformance
ref: c6949440f5b9fd6e06ea5571f4e01681dd59ee04
path: .pinned/determa-state-conformance
- name: Check out pinned specification
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: fruwehq/determa-state-spec
ref: 77c0a2e60cd0771a6d44ae170a079ddd51d7d9f0
path: .pinned/determa-state-spec
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.11"
cache: pip
- name: Install
run: pip install -e '.[dev]'
- name: Ruff
run: ruff check .
- name: Ruff format
run: ruff format --check .
- name: Mypy
run: mypy src/determa
- name: Unit tests
env:
DETERMA_CONFORMANCE_DIR: ${{ github.workspace }}/.pinned/determa-state-conformance
DETERMA_SPEC_DIR: ${{ github.workspace }}/.pinned/determa-state-spec
run: pytest -q
conformance:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check out pinned conformance suite
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: fruwehq/determa-state-conformance
ref: c6949440f5b9fd6e06ea5571f4e01681dd59ee04
path: .pinned/determa-state-conformance
- name: Check out pinned specification
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: fruwehq/determa-state-spec
ref: 77c0a2e60cd0771a6d44ae170a079ddd51d7d9f0
path: .pinned/determa-state-spec
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install
run: pip install -e '.[dev]'
- name: Install pinned conformance validator dependencies
run: python -m pip install -r .pinned/determa-state-conformance/scripts/validation-requirements.txt
- name: Conformance suite
env:
DETERMA_CONFORMANCE_DIR: ${{ github.workspace }}/.pinned/determa-state-conformance
DETERMA_SPEC_DIR: ${{ github.workspace }}/.pinned/determa-state-spec
run: |
pytest conformance -q
PYTHONPATH=src python "$DETERMA_CONFORMANCE_DIR/scripts/run_host_authority_profile.py" \
--spec-root "$DETERMA_SPEC_DIR" \
--adapter python conformance/authority_adapter.py
PYTHONPATH=src:. python "$DETERMA_CONFORMANCE_DIR/scripts/run_committed_native_effects_profile.py" \
--spec-root "$DETERMA_SPEC_DIR" \
--adapter "python conformance/effects_adapter.py" \
--authority-adapter "python conformance/worker_authority_adapter.py"
postgresql:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: determa_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d determa_test"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
cache: pip
- name: Install
run: pip install -e '.[dev,postgresql]'
- name: PostgreSQL adapter tests
env:
DETERMA_POSTGRESQL_DSN: postgresql://postgres:postgres@localhost:5432/determa_test
run: pytest tests/test_postgresql_store.py tests/test_application_projection_postgresql.py -q