Skip to content

Commit

Permalink
Issue_1993 + Issue_2057
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmesamster committed Jul 24, 2024
1 parent b7b9799 commit eed578e
Show file tree
Hide file tree
Showing 16 changed files with 1,402 additions and 94 deletions.
143 changes: 143 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: Benchmarks

on: [workflow_dispatch]

jobs:
# invoke_jasmine_tests:
# name: Invoke Jasmine performance tests
# runs-on: sh-linux-x86-chipmunk # Specify that it runs on a self-hosted runner
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: libudev-dev and install Ruby
# run: |
# whoami
# sudo yum install -y libudev-devel ruby-devel cargo npm
# sudo yum install rbenv
# rbenv install 3.1.2 -s
# rbenv global 3.1.2
# sudo chown -R $(whoami) /usr/local
# - name: install ruby:gem::dotenv
# run: sudo gem install dotenv
# - name: install ruby:gem::json
# run: sudo gem install json
# - name: install node
# uses: actions/setup-node@master
# with:
# node-version: "current"
# - name: install rust
# uses: hecrj/setup-rust-action@v1
# with:
# rust-version: stable
# - name: cargo install wasm-pack
# run: |
# pwd
# whoami
# cargo install wasm-pack --locked
# npm install -y yarn rustup
# export PATH="$HOME/.cargo/bin:$PATH"
# export PATH="$HOME/.cargo/env:$PATH"
# . "$HOME/.cargo/env"
# - name: Run Jasmine performance tests
# run: |
# source ./application/apps/rustcore/ts-bindings/spec/setup_config.sh sample_tag
# pwd
# cargo install nj-cli --locked
# source ~/.bashrc
# rustup -V
# whoami
# nj-cli --version
# printenv
# rake bindings:clean
# rake bindings:test:indexes
# rake bindings:test:search
# rake bindings:test:observe
invoke_jasmine_tests:
name: Invoke Jasmine performance tests
runs-on: self-hosted-runner-ubuntu
steps:
- name: 'Cleanup build folder'
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- name: Checkout
uses: actions/checkout@v3
- name: libudev-dev
run: |
sudo apt-get update && sudo apt-get install -y gconf-service libgbm-dev libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release xdg-utils wget ca-certificates
sudo apt-get install -y libudev-dev cargo npm imagemagick libmagickwand-dev cmake
- name: install node
uses: actions/setup-node@v4
with:
node-version: 22.4.0
- name: Install Ruby and required gems
run: |
whoami
npm install -g corepack
corepack enable
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt-get update
sudo apt-get install -y yarn
yarn --version
apt update
apt-get install -y software-properties-common
apt-add-repository -y ppa:rael-gc/rvm
apt-get update
apt-get install -y rvm
echo 'source "/etc/profile.d/rvm.sh"' >> ~/.bashrc
source /etc/profile.d/rvm.sh
which rvm
rvm install ruby-3.1.2
ruby --version
sudo chown -R $(whoami) /usr/local
rvm use 3.1.2 --default
rvm --version
rvm info
which rvm
ruby --version
- name: cargo install nj-cli
run: |
cargo install nj-cli --locked
cargo install wasm-pack --locked
- name: Run Jasmine performance tests
run: |
npm i -g tslib
export PATH="/usr/share/rvm:$PATH"
which ruby
ruby --version
pwd
gem install dotenv json octokit tmpdir fileutils
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="/root/.cargo/bin:$PATH"
. "/root/.cargo/env"
source ~/.bashrc
ruby scripts/tools/run_benchmarks.rb 10
ls -la /chipmunk/chipmunk_performance_results
env:
REPO_OWNER: 'esrlabs'
REPO_NAME: 'chipmunk'
invoke_package_distribution:
name: Move benchmark data to chipmunk-docs repository
needs: invoke_jasmine_tests
runs-on: self-hosted-runner-ubuntu
steps:
- name: Checkout chipmunk-docs repository
uses: actions/checkout@v2
with:
repository: esrlabs/chipmunk-docs
path: './chipmunk-docs'
token: ${{secrets.DOCS_PUSH_TOKEN}}
- name: Push tag
working-directory: ./chipmunk-docs
run: |
ls -la
cp /chipmunk/chipmunk_performance_results/data.json ./jekyll/benchmarks/data/data.json
git config user.name "esrlabs"
git config user.email "esrlabs@gmail.com"
git remote set-url origin "https://esrlabs:${{secrets.DOCS_PUSH_TOKEN}}@github.com/esrlabs/chipmunk-docs"
git add ./jekyll/benchmarks/data/data.json
git commit -m "Updating data.json for latest tag"
git push origin master
227 changes: 149 additions & 78 deletions .github/workflows/pullrequest_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,87 +3,158 @@ name: Checks
on: [pull_request]

jobs:
ts_lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- name: install ruby:gem::dotenv
run: gem install dotenv
- name: install ruby:gem::json
run: gem install json
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: enable corepack for yarnpkg upgrade
run: corepack enable
- name: JS/TS linting
run: rake lint:js
rust_lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: libudev-dev
run: sudo apt-get install -y libudev-dev
- name: install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- name: install ruby:gem::dotenv
run: gem install dotenv
- name: install ruby:gem::json
run: gem install json
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Rust linting
run: rake lint:rust
integration_tests:
runs-on: ubuntu-latest
# ts_lint:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: install ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: "3.0"
# bundler-cache: true
# - name: install ruby:gem::dotenv
# run: gem install dotenv
# - name: install ruby:gem::json
# run: gem install json
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# - name: enable corepack for yarnpkg upgrade
# run: corepack enable
# - name: JS/TS linting
# run: rake lint:js
# rust_lint:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: libudev-dev
# run: sudo apt-get install -y libudev-dev
# - name: install ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: "3.0"
# bundler-cache: true
# - name: install ruby:gem::dotenv
# run: gem install dotenv
# - name: install ruby:gem::json
# run: gem install json
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# - name: Rust linting
# run: rake lint:rust
# integration_tests:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: libudev-dev
# run: sudo apt-get install -y libudev-dev
# - name: install ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: "3.0"
# bundler-cache: true
# - name: install ruby:gem::dotenv
# run: gem install dotenv
# - name: install ruby:gem::json
# run: gem install json
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# - name: enable corepack for yarnpkg upgrade
# run: |
# npm install tslib
# corepack enable
# - name: Run integration tests
# run: rake test:js
# unit_tests:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: libudev-dev
# run: sudo apt-get install -y libudev-dev
# - name: install ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: "3.0"
# bundler-cache: true
# - name: Run unit tests on indexer
# run: rake test:rust
benchmarks:
name: Invoke Jasmine performance tests
runs-on: self-hosted-runner-ubuntu
steps:
- name: 'Cleanup build folder'
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: libudev-dev
run: sudo apt-get install -y libudev-dev
- name: install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- name: install ruby:gem::dotenv
run: gem install dotenv
- name: install ruby:gem::json
run: gem install json
- uses: actions-rs/toolchain@v1
run: |
sudo apt-get update && sudo apt-get install -y gconf-service libgbm-dev libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release xdg-utils wget ca-certificates
sudo apt-get install -y libudev-dev cargo npm imagemagick libmagickwand-dev cmake
- name: install node
uses: actions/setup-node@v4
with:
toolchain: stable
override: true
- name: enable corepack for yarnpkg upgrade
node-version: 22.4.0
- name: Install Ruby and required gems
run: |
npm install tslib
whoami
npm install -g corepack
corepack enable
- name: Run integration tests
run: rake test:js
unit_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: libudev-dev
run: sudo apt-get install -y libudev-dev
- name: install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- name: Run unit tests on indexer
run: rake test:rust
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt-get update
sudo apt-get install -y yarn
yarn --version
apt update
apt-get install -y software-properties-common
apt-add-repository -y ppa:rael-gc/rvm
apt-get update
apt-get install -y rvm
echo 'source "/etc/profile.d/rvm.sh"' >> ~/.bashrc
source /etc/profile.d/rvm.sh
which rvm
rvm install ruby-3.1.2
ruby --version
sudo chown -R $(whoami) /usr/local
rvm use 3.1.2 --default
rvm --version
rvm info
which rvm
ruby --version
- name: cargo install nj-cli
run: |
cargo install nj-cli --locked
cargo install wasm-pack --locked
- name: Run Jasmine performance tests
run: |
npm i -g tslib
export PATH="/usr/share/rvm:$PATH"
which ruby
ruby --version
pwd
gem install dotenv json octokit tmpdir fileutils
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="/root/.cargo/bin:$PATH"
. "/root/.cargo/env"
source ~/.bashrc
echo "PR head repo: ${{ github.event.pull_request.head.repo.name }}"
echo "PR head branch: ${{ github.event.pull_request.head.ref }}"
echo "PR head owner: ${{ github.event.pull_request.head.repo.owner.login }}"
ls -la /chipmunk/chipmunk_performance_results
printenv
ruby scripts/tools/run_benchmarks1.rb PR~${{ github.event.pull_request.number }}
env:
REPO_OWNER: ${{ github.event.pull_request.head.repo.owner.login }}
REPO_NAME: ${{ github.event.pull_request.head.repo.name }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ jobs:
git config user.email "esrlabs@gmail.com"
git remote set-url origin "https://esrlabs:${{secrets.PUSH_TOKEN}}@github.com/esrlabs/chipmunk-distribution"
git tag ${{ github.ref_name }}
git push origin ${{ github.ref_name }}
git push origin ${{ github.ref_name }}
Loading

0 comments on commit eed578e

Please sign in to comment.