Skip to content

Commit

Permalink
Merge pull request #88 from TOPLLab/integration/disco-plugin
Browse files Browse the repository at this point in the history
Version 0.3.0
  • Loading branch information
tolauwae authored Jun 14, 2023
2 parents 24bca2a + 9d7eea1 commit 6e1575c
Show file tree
Hide file tree
Showing 81 changed files with 5,701 additions and 1,499 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
"semi": "off",
"quotes": [2, "single", "avoid-escape"],
"indent": ["warn", 4, { "SwitchCase": 1 , "FunctionDeclaration": {"parameters": "first"}}]
},
"ignorePatterns": [
"out",
Expand Down
152 changes: 119 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,47 @@ jobs:
formatting-check:
name: ESLint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
node-version: 16

- name: Install Node.js dependencies
run: npm ci

- name: Run ESLint
run: npm run lint

build-wdcli:
name: Build WARDuino CLI
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive

- name: Retrieve version
run: |
cd WARDuino
echo "COMMIT=$(git rev-parse HEAD)" >> $GITHUB_STATE
echo "COMMIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
id: version

- name: Cache build files
id: cache-wdcli
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
./WARDuino/build-emu
key: ${{ env.WDCLI_CACHE }}-${{ steps.version.outputs.COMMIT }}

- name: Build from source
if: steps.cache-wdcli.outputs.cache-hit != 'true'
run: |
Expand All @@ -67,27 +68,27 @@ jobs:
build-wabt:
name: Build custom WABT
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive

- name: Retrieve version
run: |
cd WABT
echo "COMMIT=$(git rev-parse HEAD)" >> $GITHUB_STATE
echo "COMMIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
id: version

- name: Cache build files
id: cache-wabt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
./WABT/build
key: ${{ env.WABT_CACHE }}-${{ steps.version.outputs.COMMIT }}

- name: Build from source
if: steps.cache-wabt.outputs.cache-hit != 'true'
run: |
Expand All @@ -99,30 +100,95 @@ jobs:
if: steps.cache-wabt.outputs.cache-hit != 'true'
run: ./WABT/build/wasm-objdump --version

test:
name: Mocha Test Suites
test-debugger:
name: Debugger Test Suite
needs: [build-wabt, build-wdcli]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Retrieve WABT version
run: |
cd WABT
echo "::set-output name=COMMIT::$(git rev-parse HEAD)"
id: wabt

- name: Get WABT cache
id: cache-wabt
uses: actions/cache@v3
with:
path: |
./WABT/build
key: ${{ env.WABT_CACHE }}-${{ steps.wabt.outputs.COMMIT }}

- name: Update $PATH
run: echo "${GITHUB_WORKSPACE}/WABT/build" >> $GITHUB_PATH

- name: Check wat2wasm
run: wat2wasm --version

- name: Check wasm-objdump
run: wasm-objdump --version

- name: Set up Node.js
uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 16

- name: Install Node.js dependencies
run: npm ci

- name: Retrieve WARDuino version
run: |
cd WARDuino
echo "::set-output name=COMMIT::$(git rev-parse HEAD)"
id: warduino

- name: Get WARDuino cache
id: cache-wdcli
uses: actions/cache@v3
with:
path: |
./WARDuino/build-emu
key: ${{ env.WDCLI_CACHE }}-${{ steps.warduino.outputs.COMMIT }}

- name: Move wdcli
run: |
mkdir -p $HOME/Arduino/libraries/WARDuino/build-emu/
cp ./WARDuino/build-emu/wdcli $HOME/Arduino/libraries/WARDuino/build-emu/
- name: Run tests
run: npm run pretest

test-ui:
name: Plugin UI Test Suite
needs: [build-wabt, build-wdcli]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/checkout@v3
with:
node-version: 14
submodules: recursive

- name: Install Node.js dependencies
run: npm ci
- name: Retrieve WABT version
run: |
cd WABT
echo "::set-output name=COMMIT::$(git rev-parse HEAD)"
id: wabt

- name: Get WABT cache
id: cache-wabt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
./WABT/build
key: ${{ env.WABT_CACHE }}-${{ steps.version.outputs.COMMIT }}
./WABT/build
key: ${{ env.WABT_CACHE }}-${{ steps.wabt.outputs.COMMIT }}

- name: Update $PATH
run: echo "${GITHUB_WORKSPACE}/WABT/build" >> $GITHUB_PATH
Expand All @@ -133,14 +199,34 @@ jobs:
- name: Check wasm-objdump
run: wasm-objdump --version

- name: Set up Node.js
uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 16

- name: Install Node.js dependencies
run: npm ci

- name: Retrieve WARDuino version
run: |
cd WARDuino
echo "::set-output name=COMMIT::$(git rev-parse HEAD)"
id: warduino

- name: Get WARDuino cache
id: cache-wdcli
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
./WARDuino/build-emu
key: ${{ env.WDCLI_CACHE }}-${{ steps.version.outputs.COMMIT }}
key: ${{ env.WDCLI_CACHE }}-${{ steps.warduino.outputs.COMMIT }}

- name: Move wdcli
run: |
mkdir -p $HOME/Arduino/libraries/WARDuino/build-emu/
cp ./WARDuino/build-emu/wdcli $HOME/Arduino/libraries/WARDuino/build-emu/
- name: Run tests
run: npm run compiler-test
run: npm run pretest; xvfb-run -a npm run plugintest

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ node_modules
.vscode-test/
*.vsix
.idea

*.log
core/
full/
entire/
.wificredentials.json
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ This directory contains the source code for the VS Code plugin for the WARDuino

The debugger contributes the following settings:

## Testing

To run the vm tests run:

```bash
env WABT='path to wabt commands' npm run test-vm
```

To run the spec tests with Latch:

```bash
env WABT='dir with WABT commands' CORESUITE='dir with original spec test suite' npm run spectest
```

## Development Notes

Before first time use make sure you have:
Expand Down
2 changes: 1 addition & 1 deletion WABT
Submodule WABT updated 504 files
Loading

0 comments on commit 6e1575c

Please sign in to comment.