Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move js-framework-benchmark to yew monorepo #2302

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@ name: Benchmark

on:
pull_request:
if: >-
(github.event.action == 'labeled' && github.event.label.name == 'performance') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'performance'))
branches: [master]
types: [labeled, synchronize]

workflow_dispatch:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

if: >-
(github.event.action == 'labeled' && github.event.label.name == 'performance') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'performance'))

steps:
- uses: actions/checkout@v2
with:
repository: bakape/js-framework-benchmark

- name: Configure benchmark
run: |
replace="yew = { git = \"${{ github.event.pull_request.head.repo.html_url }}\", branch = \"${{ github.event.pull_request.head.ref }}\" }"
cd tools/js-framework-benchmark
replace="yew = { git = \"${REPO_HTML_URL}\", branch = \"${BRANCH}\" }"
input=$(cat frameworks/keyed/yew/Cargo.toml)
output=$(echo "$input" | sed -e "s@yew = .*}@$replace@g")
if [[ "$input" == "$output" ]]; then
Expand All @@ -29,6 +30,11 @@ jobs:
fi
echo "$output" > frameworks/keyed/yew/Cargo.toml
echo "$output"
env:
# REPO_HTML_URL: ${{ github.event.pull_request.head.repo.html_url }}
REPO_HTML_URL: https://github.com/voidpumpkin/yew.git
# HEAD_REF: ${{ github.event.pull_request.head.ref }}
BRANCH: master

- name: Setup ChromeDriver
uses: nanasess/setup-chromedriver@master
Expand Down Expand Up @@ -57,7 +63,9 @@ jobs:
use-tool-cache: true

- name: Start Server
run: http -p 8080 &
run: |
cd tools/js-framework-benchmark
http -p 8080 &

- name: Setup Node
uses: actions/setup-node@v1
Expand All @@ -66,22 +74,28 @@ jobs:

- name: npm Install
run: |
cd tools/js-framework-benchmark
npm install
(cd webdriver-ts && npm install)
(cd webdriver-ts-results && npm install)

- name: Build
run: |
cd tools/js-framework-benchmark
npm run build-prod
(cd webdriver-ts && npm run build-prod)

- name: Benchmark
run: npm run bench -- --headless
run: |
cd tools/js-framework-benchmark
npm run bench -- --headless

- name: Results
run: npm run results
run: |
cd tools/js-framework-benchmark
npm run results

- name: Log results
run: |
msg=$(cd results_diff && cargo run)
msg=$(cd tools/js-framework-benchmark/results_diff && cargo run)
echo "$msg"
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ members = [

# Tools
"tools/changelog",
"tools/js-framework-benchmark/frameworks/keyed/wasm-bindgen",
"tools/js-framework-benchmark/frameworks/keyed/yew",
"tools/js-framework-benchmark/frameworks/keyed/yew-baseline",
]
exclude = [
# Tools
"tools/website-test",
"tools/js-framework-benchmark/results_diff",
]
22 changes: 22 additions & 0 deletions tools/js-framework-benchmark/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
jobs:
build:
machine: true

steps:
- checkout

- run: |
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome.deb
sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
rm google-chrome.deb

- run: |
source $NVM_DIR/nvm.sh
nvm install v10.16.0

npm install
npm run install-webdriver-ts
npm start &
npm run build -- --check
17 changes: 17 additions & 0 deletions tools/js-framework-benchmark/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.circleci/
.dockerignore
.git/
.gitignore
cleanup.js
configureStyles.js
copy.js
favicon.ico
frameworks/
images/
LICENSE
node_modules/
package-lock.json
README.md
results-ui/
webdriver-ts/
webdriver-ts-results/
84 changes: 84 additions & 0 deletions tools/js-framework-benchmark/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
jspm_packages
bower_components
dist

.idea
.vscode
.DS_Store
*.iml
TODO.txt
*/dist/
angular*/app/app.js
angular*/app/app.js.map
angular*/src/app.ngsummary.json
tests/results/completed/
target/
webdriver-ts/results/
webdriver-ts/results*/
webdriver-ts-results/table_*.html
webdriver-ts/table_*.html
webdriver-ts/error-*.png
webdriver-ts/log*
webdriver-ts/.vscode/
webdriver-ts/prefs
results-ui/table.html
results-ui/src/data.js
marko-*/.cache
marko-*/static
marko-*/build
marko-*/src/xtable.marko
**/hyperoop/.rpt2_cache

# keep root yarn.lock in repo so that travis will install yarn
yarn.lock
!/yarn.lock

package-lock.json

# angular 2 aot
angular-*/lib/
**/app.ngfactory.ts
angular-*/src/app.ngsummary.json

#glimmer
glimmer-*/dist
glimmer-*/tmp

# rust
.cargo/
.rustup/
Cargo.lock

# emacs
*~

**/bundled-dist/*.js
**/bundled-dist/*.wasm
**/bundled-dist/*.html
54 changes: 54 additions & 0 deletions tools/js-framework-benchmark/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

FROM ubuntu:19.10
COPY install_rust.sh /root/
RUN echo "unsafe-perm = true" > /root/.npmrc
RUN echo "export NG_CLI_ANALYTICS=ci" >> /root/.npmrc
RUN echo "{ \"allow_root\": true }" > /root/.bowerrc

# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

RUN apt-get update
RUN apt-get install -y m4 libtinfo5 libghc-zlib-dev rsync ghc haskell-stack curl g++ make git openjdk-8-jdk dos2unix

ENV NVM_DIR /usr/local/nvm
RUN mkdir -p $NVM_DIR
ENV NODE_VERSION 10.16.3
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash

# install node and npm
RUN source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default

# add node and npm to path so the commands are available
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

RUN curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb > /root/google-chrome-stable_current_amd64.deb
RUN apt install -y /root/google-chrome-stable_current_amd64.deb

RUN mkdir /server
RUN mkdir /build
RUN mkdir /src

COPY package.json /server
WORKDIR /server
RUN npm install

# Volume before chown changes owwner
VOLUME /src
VOLUME /build
WORKDIR /build

# Install rust
RUN dos2unix /root/install_rust.sh
RUN bash /root/install_rust.sh

# USER user

RUN npm install
EXPOSE 8080
CMD ["/server/node_modules/.bin/http-server","-c-1","/build"]

Loading