Repository navigation
113 lines (99 loc) · 4.42 KB
/
Copy pathbuild.yml
File metadata and controls
113 lines (99 loc) · 4.42 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
name: Build
on:
push:
branches: [main, "feat/**", "fix/**", "ci/**"]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: Lint, test & package
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
enable-cache: true
- name: Install
run: |
uv venv .venv --python 3.14
.venv/bin/python -m ensurepip --upgrade
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -e ".[dev]"
- name: Lint
run: .venv/bin/ruff check src tests tools
- name: Check formatting
run: .venv/bin/ruff format --check src tests tools
- name: Test
run: .venv/bin/python -m pytest
- name: Build release-shaped artifacts
run: |
.venv/bin/python -m build
.venv/bin/python tools/build_offline.py --output dist/endkeep-offline.py
cp requirements-offline.txt dist/requirements-offline.txt
(
cd dist
sha256sum *.whl endkeep-offline.py requirements-offline.txt > SHA256SUMS
)
- name: Wheel smoke install
run: |
uv venv /tmp/endkeep-wheel-smoke --python 3.14
/tmp/endkeep-wheel-smoke/bin/python -m ensurepip --upgrade
/tmp/endkeep-wheel-smoke/bin/python -m pip install --no-deps dist/*.whl
/tmp/endkeep-wheel-smoke/bin/python - <<'PY'
from importlib.metadata import metadata
package = metadata("endstone-endkeep")
assert package["Name"] == "endstone-endkeep"
print(package["Name"], package["Version"])
PY
- name: Standalone offline smoke
run: |
.venv/bin/python tests/standalone_fixture.py /tmp/endkeep-fixture
uv venv /tmp/endkeep-offline-smoke --python 3.14
/tmp/endkeep-offline-smoke/bin/python -m ensurepip --upgrade
/tmp/endkeep-offline-smoke/bin/python -m pip install -r requirements-offline.txt
/tmp/endkeep-offline-smoke/bin/python dist/endkeep-offline.py --help
/tmp/endkeep-offline-smoke/bin/python dist/endkeep-offline.py --repo /tmp/endkeep-fixture/repo list
/tmp/endkeep-offline-smoke/bin/python dist/endkeep-offline.py --repo /tmp/endkeep-fixture/repo verify 2>/tmp/endkeep-verify-progress.log
grep -q "Verifying objects:" /tmp/endkeep-verify-progress.log
grep -q "100%" /tmp/endkeep-verify-progress.log
/tmp/endkeep-offline-smoke/bin/python dist/endkeep-offline.py --repo /tmp/endkeep-fixture/repo restore /tmp/endkeep-restored
test -f /tmp/endkeep-restored/level.dat
test -d /tmp/endkeep-restored/db
.venv/bin/python - <<'PY'
from pathlib import Path
from endstone_endkeep.repository.logicalize import Logicalizer
from tests.standalone_fixture import add_raw
storage = Path("/tmp/endkeep-fixture")
add_raw(storage, "20261006-200000", [(b"a", b"3"), (b"c", b"3")], b"third")
Logicalizer(storage, compression_level=6, compression_threads=1).logicalize(
storage / "raw" / "20261006-200000"
)
PY
/tmp/endkeep-offline-smoke/bin/python dist/endkeep-offline.py --repo /tmp/endkeep-fixture/repo delete 20261006-163000 --yes
/tmp/endkeep-offline-smoke/bin/python dist/endkeep-offline.py --repo /tmp/endkeep-fixture/repo verify
/tmp/endkeep-offline-smoke/bin/python dist/endkeep-offline.py --repo /tmp/endkeep-fixture/repo rollover 20261006-200000 --yes
/tmp/endkeep-offline-smoke/bin/python dist/endkeep-offline.py --repo /tmp/endkeep-fixture/repo verify
/tmp/endkeep-offline-smoke/bin/python dist/endkeep-offline.py --repo /tmp/endkeep-fixture/repo restore /tmp/endkeep-rolled
test -d /tmp/endkeep-rolled/db
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: endkeep-${{ github.run_id }}
path: |
dist/*.whl
dist/endkeep-offline.py
dist/requirements-offline.txt
dist/SHA256SUMS
if-no-files-found: error
retention-days: 14