ci: add pre-commit and tests workflows
All checks were successful
checks / pre-commit (push) Successful in 1m39s
checks / tests-10 (push) Successful in 1m17s
checks / tests-11 (push) Successful in 1m10s
checks / tests-12 (push) Successful in 1m13s

This commit is contained in:
cătălin 2024-08-04 15:23:55 +02:00
commit bdb5c984fa
No known key found for this signature in database
13 changed files with 339 additions and 297 deletions

View file

@ -71,19 +71,14 @@ def notebooks_path(tmp_path) -> Path:
@pytest.fixture()
def settings(notebooks_path: Path, halig_ssh_path) -> Settings:
return Settings(
notebooks_root_path=notebooks_path,
identity_paths=[halig_ssh_path / "id_ed25519"],
recipient_paths=[halig_ssh_path / "id_ed25519.pub"]
)
return Settings(notebooks_root_path=notebooks_path,identity_paths=[halig_ssh_path / "id_ed25519"],recipient_paths=[halig_ssh_path / "id_ed25519.pub"])
@pytest.fixture()
def settings_file_path(halig_config_path: Path, notebooks_path: Path) -> Path:
def settings_file_path(settings, halig_config_path: Path, notebooks_path: Path) -> Path:
yaml_file = halig_config_path / "halig.yml"
yaml_file.touch()
s = Settings(notebooks_root_path=notebooks_path)
# `.dict()` doesn't serialize some fields that yaml doesn't understand
s = Settings(notebooks_root_path=notebooks_path, identity_paths=settings.identity_paths, recipient_paths=settings.recipient_paths)
serialized = json.loads(s.model_dump_json())
with yaml_file.open("w") as f:
yaml.safe_dump(serialized, f)