Skip to content

Commit

Permalink
Reestructure repo and CI improvements (#3505)
Browse files Browse the repository at this point in the history
* Reestructure repo

* cargo update & fmt

* Fix CI

* Add newline

* Fix playground CI

* Fix CI

* Fix CI (for real this time)

* Fix CI (fr fr)
  • Loading branch information
jedel1043 authored Dec 6, 2023
1 parent 6f5c25c commit 47351ef
Show file tree
Hide file tree
Showing 697 changed files with 475 additions and 293 deletions.
50 changes: 39 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,67 @@ updates:
directory: /
schedule:
interval: daily
# CLI
- package-ecosystem: cargo
directory: /boa_cli/
directory: /cli/
schedule:
interval: daily
# CORE
- package-ecosystem: cargo
directory: /boa_engine/
directory: /core/ast/
schedule:
interval: daily
- package-ecosystem: cargo
directory: /boa_gc/
directory: /core/engine/
schedule:
interval: daily
- package-ecosystem: cargo
directory: /boa_interner/
directory: /core/gc/
schedule:
interval: daily
- package-ecosystem: cargo
directory: /boa_profiler/
directory: /core/icu_provider/
schedule:
interval: daily
- package-ecosystem: cargo
directory: /boa_tester/
directory: /core/interner/
schedule:
interval: daily
- package-ecosystem: cargo
directory: /boa_wasm/
directory: /core/macros/
schedule:
interval: daily
- package-ecosystem: cargo
directory: /fuzz/
directory: /core/parser/
schedule:
interval: daily
- package-ecosystem: gitsubmodule
directory: /
- package-ecosystem: cargo
directory: /core/profiler/
schedule:
interval: daily
- package-ecosystem: cargo
directory: /core/runtime/
schedule:
interval: daily
- package-ecosystem: cargo
directory: /core/temporal/
schedule:
interval: daily
# TESTS
- package-ecosystem: cargo
directory: /tests/tester/
schedule:
interval: weekly
interval: daily
- package-ecosystem: cargo
directory: /tests/macros/
schedule:
interval: daily
- package-ecosystem: cargo
directory: /tests/fuzz/
schedule:
interval: daily
# FFI
- package-ecosystem: cargo
directory: /ffi/wasm/
schedule:
interval: daily
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
branchName: ${{ github.base_ref }}
cwd: ./boa_engine
cwd: ./core/engine
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ jobs:
path: |
node_modules
target
boa_wasm/pkg
ffi/wasm/pkg
~/.cargo/git
~/.cargo/registry
key: ${{ runner.os }}-npm-build-target-${{ hashFiles('**/package-lock.json') }}
- run: wasm-pack build ./boa_wasm
- run: wasm-pack build ./ffi/wasm
- run: npm run build:prod
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
toolchain: stable
override: true
profile: minimal
- uses: Swatinem/rust-cache@v2
with:
key: tarpaulin
- name: Install cargo-tarpaulin
uses: baptiste0928/cargo-install@v2.2.0
with:
crate: cargo-tarpaulin
- uses: Swatinem/rust-cache@v2
with:
key: tarpaulin
- name: Run tarpaulin
uses: actions-rs/cargo@v1
with:
Expand Down Expand Up @@ -114,13 +114,13 @@ jobs:
override: true
profile: minimal
components: clippy
- uses: Swatinem/rust-cache@v2
with:
key: clippy
- name: Install cargo-workspaces
uses: actions-rs/install@v0.1
with:
crate: cargo-workspaces
- uses: Swatinem/rust-cache@v2
with:
key: clippy
- name: Clippy (All features)
run: cargo workspaces exec cargo clippy --all-features --all-targets
- name: Clippy (No features)
Expand Down Expand Up @@ -162,16 +162,16 @@ jobs:
toolchain: stable
override: true
profile: minimal
- uses: Swatinem/rust-cache@v2
with:
key: build-fuzz
- name: Install cargo-fuzz
uses: actions-rs/install@v0.1
with:
crate: cargo-fuzz
version: latest
- uses: Swatinem/rust-cache@v2
with:
key: build-fuzz
- name: Build fuzz
run: cargo fuzz build -s none
run: cd tests/fuzz && cargo fuzz build -s none --dev

build-run-examples:
name: Build & run examples
Expand All @@ -184,13 +184,13 @@ jobs:
toolchain: stable
override: true
profile: minimal
- uses: Swatinem/rust-cache@v2
with:
key: build-run-examples
- name: Install cargo-workspaces
uses: actions-rs/install@v0.1
with:
crate: cargo-workspaces
- uses: Swatinem/rust-cache@v2
with:
key: build-run-examples

- name: Build (All features)
run: cargo workspaces exec cargo build --all-features --all-targets --profile ci
Expand All @@ -199,7 +199,7 @@ jobs:

- name: Run examples
run: |
cd boa_examples
cd examples
cargo run -p boa_examples --bin 2>&1 \
| grep -E '^ ' \
| xargs -n1 sh -c 'cargo run -p boa_examples --profile ci --bin $0 || exit 255'
17 changes: 9 additions & 8 deletions .github/workflows/webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,25 @@ jobs:
toolchain: stable
override: true
profile: minimal
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- uses: Swatinem/rust-cache@v2
- name: Cache npm build
uses: actions/cache@v3
with:
path: |
node_modules
target
~/.cargo/git
~/.cargo/registry
boa_wasm/pkg
key: ${{ runner.os }}-npm-build-target-${{ hashFiles('**/package-lock.json') }}
- name: Install wasm-pack
uses: baptiste0928/cargo-install@v2.2.0
with:
crate: wasm-pack
- uses: actions/setup-node@v4
with:
node-version: "16"
- run: npm ci
- run: cd boa_wasm && wasm-pack --verbose build --out-name index --out-dir ./pkg
- run: npm run build
- name: Build Playground
run: |
wasm-pack build ./ffi/wasm --verbose
npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright test
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ node_modules
yarn-error.log
.vscode/settings.json

# tests/js is used for testing changes locally
tests/js
# debug is used for testing changes locally
/debug
.boa_history

# test262 testing suite
Expand Down
7 changes: 3 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
*.yml
target
node_modules
boa_engine/benches/bench_scripts/mini_js.js
boa_engine/benches/bench_scripts/clean_js.js
boa_wasm/pkg
core/engine/benches/bench_scripts/mini_js.js
core/engine/benches/bench_scripts/clean_js.js
ffi/wasm/pkg
dist
test262
tests/js/test.js
playwright-report
test-results
24 changes: 19 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,46 @@
{
"type": "lldb",
"request": "launch",
"name": "Launch (Script)",
"name": "Debug Boa (Script mode)",
"windows": {
"program": "${workspaceFolder}/target/debug/boa.exe"
},
"program": "${workspaceFolder}/target/debug/boa",
"args": ["${workspaceFolder}/tests/js/test.js", "--debug-object"],
"args": ["${workspaceFolder}/${input:filePath}", "--debug-object"],
"sourceLanguages": ["rust"],
"preLaunchTask": "Cargo Build boa_cli"
},
{
"type": "lldb",
"request": "launch",
"name": "Launch (Module)",
"name": "Debug Boa (Module mode)",
"windows": {
"program": "${workspaceFolder}/target/debug/boa.exe"
},
"program": "${workspaceFolder}/target/debug/boa",
"args": [
"${workspaceFolder}/tests/js/test.js",
"${workspaceFolder}/${input:filePath}",
"--debug-object",
"-m",
"-r",
"tests/js"
"${workspaceFolder}/${input:modulePath}"
],
"sourceLanguages": ["rust"],
"preLaunchTask": "Cargo Build boa_cli"
}
],
"inputs": [
{
"id": "filePath",
"description": "Relative path to the file to run",
"default": "debug/script.js",
"type": "promptString"
},
{
"id": "modulePath",
"description": "Relative path to the module root directory",
"default": "debug",
"type": "promptString"
}
]
}
23 changes: 9 additions & 14 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
},
{
"type": "process",
"label": "Cargo Run",
"label": "Run JS file",
"command": "cargo",
"args": ["run", "--bin", "boa", "./tests/js/test.js"],
"args": ["run", "--bin", "boa", "${file}"],
"group": {
"kind": "build",
"isDefault": true
Expand All @@ -44,20 +44,15 @@
},
{
"type": "process",
"label": "Cargo Run (Profiler)",
"label": "Run JS file (Profiler)",
"command": "cargo",
"args": [
"run",
"--features",
"boa_engine/profiler",
"../tests/js/test.js"
],
"args": ["run", "--features", "profiler", "${file}"],
"group": "build",
"options": {
"env": {
"RUST_BACKTRACE": "full"
},
"cwd": "${workspaceFolder}/boa_cli"
"cwd": "${workspaceFolder}/cli"
},
"presentation": {
"clear": true
Expand All @@ -66,9 +61,9 @@
},
{
"type": "process",
"label": "Run with VM trace",
"label": "Run JS file with VM trace",
"command": "cargo",
"args": ["run", "--bin", "boa", "--", "-t", "./tests/js/test.js"],
"args": ["run", "--bin", "boa", "--", "-t", "${file}"],
"group": "build",
"presentation": {
"clear": true
Expand All @@ -77,9 +72,9 @@
},
{
"type": "process",
"label": "Get AST",
"label": "Get AST for JS file",
"command": "cargo",
"args": ["run", "--bin", "boa", "--", "-a=Debug", "./tests/js/test.js"],
"args": ["run", "--bin", "boa", "--", "-a=Debug", "${file}"],
"group": "build",
"presentation": {
"clear": true
Expand Down
Loading

0 comments on commit 47351ef

Please sign in to comment.