Skip to content

Commit

Permalink
Align with PR 58
Browse files Browse the repository at this point in the history
  • Loading branch information
smiasojed committed Apr 27, 2024
1 parent 55f491b commit 9cbf2d5
Showing 1 changed file with 60 additions and 62 deletions.
122 changes: 60 additions & 62 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,65 +15,65 @@ env:
BENCHMARK_URI: https://raw.githubusercontent.com/smiasojed/smart-bench/gh-pages

jobs:
# build_dev_moonbeam:
# runs-on: ubuntu-20.04
# defaults:
# run:
# shell: bash
# steps:
# - name: Clean worker
# run: |
# sudo rm -rf /usr/share/dotnet
# sudo rm -rf /opt/ghc
# sudo rm -rf "/usr/local/share/boost"
# sudo rm -rf "$AGENT_TOOLSDIRECTORY"

# - uses: actions/checkout@v4
# with:
# sparse-checkout: |
# launch/moonbeam.patch
# sparse-checkout-cone-mode: false

# - name: Download Moonbeam Release
# run: |
# API_URL="https://api.github.com/repos/moonbeam-foundation/moonbeam/releases/131808906"
# RESPONSE=$(curl -s "${API_URL}")
# # Remove control characters causing error while parsing
# RESPONSE=$(echo $RESPONSE | tr -cd '[:print:]')
# DOWNLOAD_URL=$(echo $RESPONSE | jq -r '.tarball_url')
# RELEASE_TAG=$(echo $RESPONSE | jq -r '.tag_name')
# mkdir ${{ env.MOONBEAM_DIR }}
# echo "Download moonbeam release: ${DOWNLOAD_URL}"
# curl -L ${DOWNLOAD_URL} | tar -xzv -C ${{ env.MOONBEAM_DIR }}
# echo $RELEASE_TAG > ${{ env.MOONBEAM_DIR }}/${{ env.MOONBEAM_VERSION }}

# - name: Patch
# run: |
# # Add Dev RPC support
# cd moonbeam_release/*/
# patch -p1 < ../../launch/moonbeam.patch

# - name: Build
# uses: docker://paritytech/ci-unified:bullseye-1.73.0
# with:
# args: /bin/bash -c "cd moonbeam_release/*/ && cargo build --release"

# - uses: actions/upload-artifact@v3
# with:
# name: ${{ env.MOONBEAM_ARTIFACT }}
# path: |
# ./${{ env.MOONBEAM_BIN }}
# ./${{ env.MOONBEAM_DIR }}/${{ env.MOONBEAM_VERSION }}
# retention-days: 1
build_dev_moonbeam:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
steps:
- name: Clean worker
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4
with:
sparse-checkout: |
launch/moonbeam.patch
sparse-checkout-cone-mode: false

- name: Download Moonbeam Release
run: |
API_URL="https://api.github.com/repos/moonbeam-foundation/moonbeam/releases/131808906"
RESPONSE=$(curl -s "${API_URL}")
# Remove control characters causing error while parsing
RESPONSE=$(echo $RESPONSE | tr -cd '[:print:]')
DOWNLOAD_URL=$(echo $RESPONSE | jq -r '.tarball_url')
RELEASE_TAG=$(echo $RESPONSE | jq -r '.tag_name')
mkdir ${{ env.MOONBEAM_DIR }}
echo "Download moonbeam release: ${DOWNLOAD_URL}"
curl -L ${DOWNLOAD_URL} | tar -xzv -C ${{ env.MOONBEAM_DIR }}
echo $RELEASE_TAG > ${{ env.MOONBEAM_DIR }}/${{ env.MOONBEAM_VERSION }}
- name: Patch
run: |
# Add Dev RPC support
cd moonbeam_release/*/
patch -p1 < ../../launch/moonbeam.patch
- name: Build
uses: docker://paritytech/ci-unified:bullseye-1.73.0
with:
args: /bin/bash -c "cd moonbeam_release/*/ && cargo build --release"

- uses: actions/upload-artifact@v3
with:
name: ${{ env.MOONBEAM_ARTIFACT }}
path: |
./${{ env.MOONBEAM_BIN }}
./${{ env.MOONBEAM_DIR }}/${{ env.MOONBEAM_VERSION }}
retention-days: 1

smart_contract_benchmark:
strategy:
matrix:
type: [ink-wasm, sol-wasm, evm]
contract: [erc20, flipper, triangle-number, storage-read, storage-write ]
contract: [erc20, flipper, triangle-number, storage-read, storage-write]
env:
BENCHMARK_FILE: benchmark_${{ matrix.type }}_${{ matrix.contract }}.csv
# needs: build_dev_moonbeam
needs: build_dev_moonbeam
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -82,20 +82,19 @@ jobs:
- name: Cache
uses: Swatinem/rust-cache@v2

# - uses: actions/download-artifact@v3
# with:
# name: ${{ env.MOONBEAM_ARTIFACT }}
# path: ./${{ env.MOONBEAM_DIR }}
- uses: actions/download-artifact@v3
with:
name: ${{ env.MOONBEAM_ARTIFACT }}
path: ./${{ env.MOONBEAM_DIR }}

- name: Set Moonbeam Release
id: moonbeam_release
run: |
mkdir bin
# cp ${{ env.MOONBEAM_BIN }} bin/moonbeam
# chmod +x bin/moonbeam
# RELEASE_TAG=$(cat ${{ env.MOONBEAM_DIR }}/${{ env.MOONBEAM_VERSION }})
# echo "tag=$(echo ${RELEASE_TAG})" >> $GITHUB_OUTPUT
echo "tag=mon" >> $GITHUB_OUTPUT
cp ${{ env.MOONBEAM_BIN }} bin/moonbeam
chmod +x bin/moonbeam
RELEASE_TAG=$(cat ${{ env.MOONBEAM_DIR }}/${{ env.MOONBEAM_VERSION }})
echo "tag=$(echo ${RELEASE_TAG})" >> $GITHUB_OUTPUT
- name: Download Polkadot-Parachain Release
id: polkadot_parachain_release
Expand Down Expand Up @@ -225,7 +224,6 @@ jobs:
fi
cat $file >> ${{ env.BENCHMARK_DIR }}/${benchmark_file}
done
find ./stats
- name: Generate graph
run: |
Expand Down

0 comments on commit 9cbf2d5

Please sign in to comment.