summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/mpy_format.yml18
-rwxr-xr-xtools/ci.sh17
2 files changed, 35 insertions, 0 deletions
diff --git a/.github/workflows/mpy_format.yml b/.github/workflows/mpy_format.yml
new file mode 100644
index 000000000..ab90bb339
--- /dev/null
+++ b/.github/workflows/mpy_format.yml
@@ -0,0 +1,18 @@
+name: .mpy file format and tools
+
+on:
+ push:
+ pull_request:
+ paths:
+ - '.github/workflows/*.yml'
+ - 'tools/**'
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install packages
+ run: source tools/ci.sh && ci_mpy_format_setup
+ - name: Test mpy-tool.py
+ run: source tools/ci.sh && ci_mpy_format_test
diff --git a/tools/ci.sh b/tools/ci.sh
index 3e78ae4a0..075e5e423 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -68,6 +68,23 @@ function ci_code_size_build {
}
########################################################################################
+# .mpy file format
+
+function ci_mpy_format_setup {
+ sudo pip3 install pyelftools
+}
+
+function ci_mpy_format_test {
+ # Test mpy-tool.py dump feature on bytecode
+ python2 ./tools/mpy-tool.py -xd ports/minimal/frozentest.mpy
+ python3 ./tools/mpy-tool.py -xd ports/minimal/frozentest.mpy
+
+ # Test mpy-tool.py dump feature on native code
+ make -C examples/natmod/features1
+ ./tools/mpy-tool.py -xd examples/natmod/features1/features1.mpy
+}
+
+########################################################################################
# ports/cc3200
function ci_cc3200_setup {