Skip to content

Commit

Permalink
Merge branch 'feat/unified' into unified
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Jan 29, 2024
2 parents cad0c63 + aab2ab7 commit df6d99c
Show file tree
Hide file tree
Showing 1,075 changed files with 5,835 additions and 4,322 deletions.
146 changes: 138 additions & 8 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,141 @@ permissions:
pull-requests: write

jobs:
contracts:
name: Contracts
uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.5
with:
rust-toolchain: nightly-2023-12-11
vmtools-version: v1.5.19
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
wasm_test:
name: Wasm tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-11
target: wasm32-unknown-unknown

- name: Install prerequisites
run: |
pipx install multiversx-sdk-cli==v9.3.1
cargo install wasm-opt
cargo install twiggy
cargo install --path framework/meta
sc-meta install mx-scenario-go --tag v2.0.0
which mxpy
which wasm-opt
which mx-scenario-go
- name: Build the wasm contracts
env:
RUSTFLAGS: ""
run: sc-meta all build --no-imports --target-dir $(pwd)/target --path .

- name: Run the wasm tests
env:
RUSTFLAGS: ""
run:
cargo test --features multiversx-sc-scenario/run-go-tests

- name: Generate the contract report
env:
RUSTFLAGS: ""
run: |
sc-meta all build-dbg --twiggy-paths --target-dir $(pwd)/target --path .
mxpy contract report --skip-build --skip-twiggy --output-format json --output-file report.json
- name: Upload the report json
uses: actions/upload-artifact@v3
with:
name: report
path: report.json

- name: Download the base report
uses: dawidd6/action-download-artifact@v2
if: github.event_name == 'pull_request'
continue-on-error: true
with:
workflow: actions.yml
name: report
commit: ${{ github.event.pull_request.base.sha }}
path: base-report

- name: Generate the report template
if: github.event_name == 'pull_request'
run: |
echo "Contract comparison - from {{ .base }} to {{ .head }}" > report.md
if [ ! -f base-report/report.json ]
then
echo ":warning: Warning: Could not download the report for the base branch. Displaying only the report for the current branch. :warning:" >> report.md
mxpy contract report --compare report.json --output-format github-markdown --output-file report-table.md
else
mxpy contract report --compare base-report/report.json report.json --output-format github-markdown --output-file report-table.md
fi
cat report-table.md >> report.md
- name: Render the report from the template
id: template
uses: chuhlomin/render-template@v1
if: github.event_name == 'pull_request'
with:
template: report.md
vars: |
base: ${{ github.event.pull_request.base.sha }}
head: ${{ github.event.pull_request.head.sha }}
- name: Upload the report markdown
uses: actions/upload-artifact@v3
if: github.event_name == 'pull_request'
with:
name: report-markdown
path: report.md

- name: Find the comment containing the report
id: fc
uses: peter-evans/find-comment@v2
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'Contract comparison'

- name: Create or update the report comment
uses: peter-evans/create-or-update-comment@v2
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.template.outputs.result }}
edit-mode: replace

rust_test:
name: Rust tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-11

- name: Run the rust tests
env:
RUSTFLAGS: ""
run:
cargo test

clippy_check:
name: Clippy linter check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-11
components: clippy
- uses: giraffate/clippy-action@v1
env:
RUSTFLAGS: ""
with:
github_token: ${{ github.token }}
clippy_flags: --all-targets --all-features
20 changes: 5 additions & 15 deletions .github/workflows/template-test-current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,15 @@ jobs:
toolchain: nightly-2023-12-11
target: wasm32-unknown-unknown

- name: Setup the PATH variable
run: |
echo "PATH=$HOME/.local/bin:$HOME/multiversx-sdk/vmtools:$PATH" >> $GITHUB_ENV
- name: Install prerequisites
run: |
pip3 install multiversx-sdk-cli==v6.0.0
mkdir $HOME/multiversx-sdk
python3 -m multiversx_sdk_cli.cli deps install vmtools --tag v1.4.60
wget -O binaryen.tar.gz https://github.com/WebAssembly/binaryen/releases/download/version_112/binaryen-version_112-x86_64-linux.tar.gz
tar -xf binaryen.tar.gz
cp binaryen-version_112/bin/wasm-opt $HOME/.local/bin
sudo apt install -y wabt=1.0.27-1
cargo install wasm-opt
cargo install --path framework/meta
sc-meta install mx-scenario-go --tag v2.0.0
which wasm-opt
which wasm2wat
which run-scenarios
which mx-scenario-go
mx-scenario-go --version
- name: Run template tool test
run: |
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/template-test-released.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,15 @@ jobs:
toolchain: nightly-2023-12-11
target: wasm32-unknown-unknown

- name: Setup the PATH variable
run: |
echo "PATH=$HOME/.local/bin:$HOME/multiversx-sdk/vmtools:$PATH" >> $GITHUB_ENV
- name: Install prerequisites
run: |
pip3 install multiversx-sdk-cli==v6.0.0
mkdir $HOME/multiversx-sdk
python3 -m multiversx_sdk_cli.cli deps install vmtools --tag v1.4.60
wget -O binaryen.tar.gz https://github.com/WebAssembly/binaryen/releases/download/version_112/binaryen-version_112-x86_64-linux.tar.gz
tar -xf binaryen.tar.gz
cp binaryen-version_112/bin/wasm-opt $HOME/.local/bin
sudo apt install -y wabt=1.0.27-1
cargo install wasm-opt
cargo install --path framework/meta
sc-meta install mx-scenario-go --tag v2.0.0
which wasm-opt
which wasm2wat
which run-scenarios
which mx-scenario-go
mx-scenario-go --version
- name: Run template tool test
run: |
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ They are:
- `multiversx-chain-scenario-format`, in short `scenario-format`, scenario JSON serializer/deserializer, 1 crate.
- `multiversx-sdk`, in short `sdk`, allows communication with the chain(s), 1 crate.

## [sc 0.47.1, codec 0.18.5, vm 0.8.1, scenario-format 0.22.1] - 2024-01-29
- Blockchain hooks: `get_code_metadata`, `is_builtin_function`.
- Support for `mxsc:` syntax in scenarios.
- Updated dependencies.

## [sc 0.47.0, codec 0.18.4, vm 0.8.0, scenario-format 0.22.0] - 2024-01-23
- Added support for the code metadata in the Rust VM and Rust scenarios backend.
- `sc-meta`:
- New `mx-scenario-go` installer;
- `--nocapture` flag added in `sc-meta test` CLI;
- Framework version system refactor,
- `SetMapper` and `QueueMapper` can read from another contract.
- Fixed an edge case when generating enum encoding.

## [sc 0.46.1] - 2024-01-10
- Interactor: fixed parsing of newly issued token identifier.

Expand Down
Loading

0 comments on commit df6d99c

Please sign in to comment.