Skip to content

Commit

Permalink
javascript: Rename this port to 'webassembly'.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntoll committed Aug 22, 2022
1 parent c616721 commit af54d2c
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: javascript port
name: webassembly port

on:
push:
Expand All @@ -9,16 +9,16 @@ on:
- 'py/**'
- 'extmod/**'
- 'lib/**'
- 'ports/javascript/**'
- 'ports/webassembly/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install packages
run: source tools/ci.sh && ci_javascript_setup
run: source tools/ci.sh && ci_webassembly_setup
- name: Build
run: source tools/ci.sh && ci_javascript_build
run: source tools/ci.sh && ci_webassembly_build
- name: Run tests
run: source tools/ci.sh && ci_javascript_run_tests
run: source tools/ci.sh && ci_webassembly_run_tests
2 changes: 1 addition & 1 deletion ports/javascript/Makefile → ports/webassembly/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ min: $(BUILD)/micropython.js

test: $(BUILD)/micropython.js $(TOP)/tests/run-tests.py
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
cd $(TOP)/tests && MICROPY_MICROPYTHON=../ports/javascript/node_run.sh ./run-tests.py -j1
cd $(TOP)/tests && MICROPY_MICROPYTHON=../ports/webassembly/node_run.sh ./run-tests.py -j1

include $(TOP)/py/mkrules.mk
15 changes: 10 additions & 5 deletions ports/javascript/README.md → ports/webassembly/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
MicroPython.js
==============
MicroPython WebAssembly
=======================

MicroPython transmuted into Javascript by Emscripten.
MicroPython for [WebAssembly](https://webassembly.org/).

Dependencies
------------

Building micropython.js bears the same requirements as the standard MicroPython
ports with the addition of Emscripten (and uglify-js for the minified file).
Building webassembly port bears the same requirements as the standard
MicroPython ports with the addition of Emscripten (and uglify-js for the
minified file).

The output includes `micropython.js` (a JavaScript wrapper for the
MicroPython runtime) and `firmware.wasm` (actual MicroPython compiled to
WASM).

Build instructions
------------------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
#define MICROPY_PY_SYS_PLATFORM "javascript"
#define MICROPY_PY_SYS_PLATFORM "webassembly"
#define MICROPY_PY_UERRNO (1)
#define MICROPY_PY_UCTYPES (1)
#define MICROPY_PY_UZLIB (1)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,21 @@ function ci_esp8266_build {
}

########################################################################################
# ports/javascript
# ports/webassembly

function ci_javascript_setup {
function ci_webassembly_setup {
git clone https://github.com/emscripten-core/emsdk.git
(cd emsdk && ./emsdk install latest && ./emsdk activate latest)
}

function ci_javascript_build {
function ci_webassembly_build {
source emsdk/emsdk_env.sh
make ${MAKEOPTS} -C ports/javascript
make ${MAKEOPTS} -C ports/webassembly
}

function ci_javascript_run_tests {
function ci_webassembly_run_tests {
# This port is very slow at running, so only run a few of the tests.
(cd tests && MICROPY_MICROPYTHON=../ports/javascript/node_run.sh ./run-tests.py -j1 basics/builtin_*.py)
(cd tests && MICROPY_MICROPYTHON=../ports/webassembly/node_run.sh ./run-tests.py -j1 basics/builtin_*.py)
}

########################################################################################
Expand Down

0 comments on commit af54d2c

Please sign in to comment.