Repository navigation
52 lines (49 loc) · 1.95 KB
/
Copy pathpython.yml
File metadata and controls
52 lines (49 loc) · 1.95 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
name: Python validation
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
python:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python: ['3.11', '3.12']
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- name: Unit regressions
run: python -m unittest discover -s octanify/tests -p "test_*.py"
- name: Python syntax
run: python -m compileall -q octanify/core octanify/ui octanify/utils octanify/tools octanify/tests
- name: Deterministic runtime package
shell: python
run: |
import pathlib, sys, tempfile, zipfile
sys.path.insert(0, 'octanify/tools')
from build_candidate import build, runtime_sources, FIXED_ZIP_TIME
with tempfile.TemporaryDirectory() as directory:
root = pathlib.Path(directory)
first = build(root / 'first')
second = build(root / 'second')
assert first['sha256'] == second['sha256']
assert pathlib.Path(first['archive']).read_bytes() == pathlib.Path(second['archive']).read_bytes()
sources = runtime_sources()
with zipfile.ZipFile(first['archive']) as bundle:
assert bundle.namelist() == ['octanify/' + name for name in sorted(sources)]
for name, source in sources.items():
info = bundle.getinfo('octanify/' + name)
assert bundle.read(info) == source.read_bytes()
assert info.date_time == FIXED_ZIP_TIME
assert info.external_attr >> 16 == 0o100644
print('Deterministic allowlist/package checks passed:', first['sha256'])
- name: Source whitespace
run: git diff --check