25 lines
715 B
Python
25 lines
715 B
Python
from pathlib import Path
|
|
|
|
|
|
WORKFLOW = Path(".gitea/workflows/release.yml")
|
|
|
|
|
|
def test_release_workflow_uses_gitea_api_not_github_cli():
|
|
text = WORKFLOW.read_text()
|
|
assert "gh release" not in text
|
|
assert "/api/v1/repos/${{ github.repository }}/tags" in text
|
|
assert "/api/v1/repos/${{ github.repository }}/releases" in text
|
|
|
|
|
|
def test_release_workflow_targets_merge_commit_and_marks_rc():
|
|
text = WORKFLOW.read_text()
|
|
assert 'TARGET="${{ github.sha }}"' in text
|
|
assert '"prerelease":true' in text
|
|
assert '"draft":false' in text
|
|
|
|
|
|
def test_release_workflow_fails_on_api_error():
|
|
text = WORKFLOW.read_text()
|
|
assert "curl --fail-with-body" in text
|
|
assert "|| true" not in text
|