Skip to content

Commit 73a1927

Browse files
committed
github/workflows: Add new workflow to test .mpy file format and tools.
Signed-off-by: Damien George <[email protected]>
1 parent c0f2af4 commit 73a1927

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/workflows/mpy_format.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: .mpy file format and tools
2+
3+
on:
4+
push:
5+
pull_request:
6+
paths:
7+
- '.github/workflows/*.yml'
8+
- 'tools/**'
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Install packages
16+
run: source tools/ci.sh && ci_mpy_format_setup
17+
- name: Test mpy-tool.py
18+
run: source tools/ci.sh && ci_mpy_format_test

tools/ci.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,23 @@ function ci_code_size_build {
6767
tools/metrics.py build bm | tee ~/size1
6868
}
6969

70+
########################################################################################
71+
# .mpy file format
72+
73+
function ci_mpy_format_setup {
74+
sudo pip3 install pyelftools
75+
}
76+
77+
function ci_mpy_format_test {
78+
# Test mpy-tool.py dump feature on bytecode
79+
python2 ./tools/mpy-tool.py -xd ports/minimal/frozentest.mpy
80+
python3 ./tools/mpy-tool.py -xd ports/minimal/frozentest.mpy
81+
82+
# Test mpy-tool.py dump feature on native code
83+
make -C examples/natmod/features1
84+
./tools/mpy-tool.py -xd examples/natmod/features1/features1.mpy
85+
}
86+
7087
########################################################################################
7188
# ports/cc3200
7289

0 commit comments

Comments
 (0)