adding missing work #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compile CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master", "*" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # fetches all history so that you can switch branches | |
# Cache Solidity & Wasm tools | |
- name: Cache solidity and wasm tools | |
uses: actions/cache@v2 | |
with: | |
path: | | |
/usr/bin/solc | |
/usr/bin/wabt | |
key: ${{ runner.os }}-solidity-wasm-tools | |
- name: Install solidity & wasm tools | |
run: | | |
sudo add-apt-repository ppa:ethereum/ethereum | |
sudo apt-get update | |
sudo apt-get install -y wabt solc | |
# Cache Rustup toolchain and targets | |
- name: Cache rustup toolchain and targets | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.rustup | |
~/.cargo/bin | |
key: ${{ runner.os }}-rustup-toolchain-targets-${{ hashFiles('**/rust-toolchain') }} | |
- name: Install Rust toolchain | |
if: steps.cache-rustup-toolchain-targets.outputs.cache-hit != 'true' | |
run: rustup self update | |
- name: Add wasi target | |
if: steps.cache-rustup-toolchain-targets.outputs.cache-hit != 'true' | |
run: rustup target add wasm32-wasi | |
- name: Add unknown target | |
if: steps.cache-rustup-toolchain-targets.outputs.cache-hit != 'true' | |
run: rustup target add wasm32-unknown-unknown | |
# Cache Rust dependencies | |
- name: Cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo target | |
uses: actions/cache@v2 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install dependecies | |
run: cargo fetch | |
- name: Build | |
run: make | |
- name: Run unit tests | |
run: make check | |
- name: Install dependencies for lints | |
run: | | |
rustup component add rustfmt --toolchain nightly-2022-09-07-x86_64-unknown-linux-gnu | |
rustup component add clippy --toolchain nightly-2022-09-07-x86_64-unknown-linux-gnu | |
- name: Lints | |
run: | | |
cargo fmt --check | |
cargo clippy --workspace -- -D warnings | |
- name: Install Wasmtime & Run tests | |
run: | | |
curl https://wasmtime.dev/install.sh -sSf | bash | |
export WASMTIME_HOME="$HOME/.wasmtime" | |
export PATH="$WASMTIME_HOME/bin:$PATH"SELENIUM_JAR_PATH=/usr/share/java/selenium-server.jar | |
bash -c "python3 tools/tests.py" | |
- name: Install pandas | |
run: pip3 install pandas | |
- name: Run benchmark | |
run: python3 tools/bench.py | |
- name: Some debug | |
run: | | |
env | |
git log | |
- name: Checkout gh-pages branch | |
run: | | |
git fetch origin gh-pages | |
git checkout gh-pages | |
- name: Copy generated CSV files | |
run: cp -r tools/benchmark/csvs/* csvs/ | |
- name: Commit and push changes to gh-pages | |
run: | | |
git config user.name "MCJOHN974" | |
git config user.email "[email protected]" | |
git add csvs/ | |
git commit -m "Benchmark workflow" | |
git push origin gh-pages |