Skip to content

Commit 2e360d3

Browse files
committed
Add basic Github Workflow to run unit tests
1 parent 55b04c4 commit 2e360d3

File tree

4 files changed

+55
-20
lines changed

4 files changed

+55
-20
lines changed

.github/workflows/run_tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Example
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
name: memory-profiler
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version:
12+
- "3.11"
13+
- "3.12"
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v2
20+
with:
21+
# Install a specific version of uv.
22+
version: "0.4.2"
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
run: uv python install ${{ matrix.python-version }}
26+
27+
- name: Install the project
28+
run: uv sync --all-extras --dev
29+
30+
- name: Run tests
31+
# For example, using `pytest`
32+
run: uv run pytest rendering_tools/tests

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[project]
2+
name = "micropython-memory-profiler"
3+
version = "0.1.0"
4+
description = "A memory profiler for use with MicroPython"
5+
readme = "rendering_tools/README.md"
6+
requires-python = ">=3.11"
7+
dependencies = [
8+
"pycairo>=1.26.1",
9+
"pytest>=8.3.2",
10+
]
11+
12+
[tool.pytest.ini_options]
13+
pythonpath = [
14+
"rendering_tools"
15+
]

rendering_tools/pyproject.toml

Lines changed: 0 additions & 15 deletions
This file was deleted.

rendering_tools/tests/frame_parser_test.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
class TestHeapFrame:
55
def test_unix(self):
66
heap = [
7-
"mem: total=74627, current=42583, peak=42639"
8-
"stack: 7312 out of 80000"
9-
"GC: total: 2072832, used: 48160, free: 2024672"
10-
" No. of 1-blocks: 680, 2-blocks: 80, max blk sz: 91, max free sz: 63271"
11-
"GC memory layout; from 7f3795121f00:"
7+
"mem: total=74627, current=42583, peak=42639",
8+
"stack: 7312 out of 80000",
9+
"GC: total: 2072832, used: 48160, free: 2024672",
10+
" No. of 1-blocks: 680, 2-blocks: 80, max blk sz: 91, max free sz: 63271",
11+
"GC memory layout; from 7f3795121f00:",
12+
"00000000: MDhh=hhLhhSh===h========hhhBMDhBShThSBBMDh==BShBDBDBBBhBhBBBBh==",
13+
"00000800: =h===T==B==BBBTB=BBBT=B=h=h========MDShhSh========hhShMhShh==hhS",
14+
"@@@",
1215
]
1316
frame = HeapFrame(1234, heap)
1417
print("test unix")

0 commit comments

Comments
 (0)