Skip to content

Commit

Permalink
Merge branch 'main' into update-rust-2024-01-02
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Jan 3, 2024
2 parents 5e67b78 + ac736d4 commit 310a0b0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_long_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Build
run: |
export PYTHONPATH=.
python ./integration_tests/test_previous_builds_are_reproducible.py --selected-builds "a.1"
python ./integration_tests/test_previous_builds_are_reproducible.py --selected-builds "a.1" "a.2" "a.3"
- name: Save artifacts
uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:22.04

# Constants
ARG BUILDER_NAME="multiversx/sdk-rust-contract-builder:v6.0.0-beta.0"
ARG BUILDER_NAME="multiversx/sdk-rust-contract-builder:v6.0.0"
ARG VERSION_RUST="nightly-2023-12-11"
ARG VERSION_BINARYEN="version_112"
ARG DOWNLOAD_URL_BINARYEN="https://github.com/WebAssembly/binaryen/releases/download/${VERSION_BINARYEN}/binaryen-${VERSION_BINARYEN}-x86_64-linux.tar.gz"
Expand Down Expand Up @@ -39,7 +39,7 @@ RUN wget -O rustup.sh https://sh.rustup.rs && \
rm -rf /rust/registry

# Install sc-tool
RUN PATH="/rust/bin:${PATH}" CARGO_HOME=/rust RUSTUP_HOME=/rust cargo install multiversx-sc-meta --locked --version ${VERSION_SC_META} && \
RUN PATH="/rust/bin:${PATH}" CARGO_HOME=/rust RUSTUP_HOME=/rust cargo install multiversx-sc-meta --version ${VERSION_SC_META} --locked && \
rm -rf /rust/registry

COPY "multiversx_sdk_rust_contract_builder" "/multiversx_sdk_rust_contract_builder"
Expand Down
26 changes: 26 additions & 0 deletions integration_tests/previous_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,32 @@ def __init__(self, name: str,
previous_builds: List[PreviousBuild] = [
PreviousBuild(
name="a.1",
project_archive_url="https://github.com/multiversx/mx-exchange-sc/archive/refs/heads/reproducible-v2.1.1-staking-upgrade.zip",
project_relative_path_in_archive="mx-exchange-sc-reproducible-v2.1.1-staking-upgrade",
packaged_src_url=None,
contract_name=None,
expected_code_hashes={
"farm-staking": "6dc7c587b2cc4b177a192b709c092f3752b3dcf9ce1b484e69fe64dc333a9e0a",
"farm": "931ca233826ff9dacd889967365db1cde9ed8402eb553de2a3b9d58b6ff1098d",
"factory": "df06465b651594605466e817bfe9d8d7c68eef0f87df4a8d3266bcfb1bef6d83",
"pair": "f3f08ebd758fada871c113c18017d9761f157d00b19c4d3beaba530e6c53afc2",
"energy-factory": "241600c055df605cafd85b75d40b21316a6b35713485201b156d695b23c66a2f"
},
docker_image="multiversx/sdk-rust-contract-builder:v4.2.1"
),
PreviousBuild(
name="a.2",
project_archive_url="https://github.com/multiversx/mx-metabonding-sc/archive/refs/heads/reproducible-v1.1.1.zip",
project_relative_path_in_archive="mx-metabonding-sc-reproducible-v1.1.1",
packaged_src_url=None,
contract_name=None,
expected_code_hashes={
"metabonding": "897b19e1990f7c487c99c12f50722febe1ee4468bcd3a7405641966dfff2791d"
},
docker_image="multiversx/sdk-rust-contract-builder:v4.2.1"
),
PreviousBuild(
name="a.3",
project_archive_url="https://github.com/multiversx/mx-reproducible-contract-build-example-sc/archive/refs/tags/v0.4.6.zip",
project_relative_path_in_archive="mx-reproducible-contract-build-example-sc-0.4.6",
packaged_src_url=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,20 @@

def main(cli_args: List[str]):
repository_url = "https://github.com/multiversx/mx-reproducible-contract-build-example-sc"
tag = "0.4.6"
tag = "0.4.7-beta.1"
archve_subfolder = f"mx-reproducible-contract-build-example-sc-{tag}"
project_path = download_project_repository(f"{repository_url}/archive/refs/tags/v{tag}.zip", archve_subfolder)
project_path = project_path / archve_subfolder

# Only package_whole_project_src = True works.
# package_whole_project_src = False does not work, since a missing Cargo.lock at the workspace level leads to build errors.
check_project_folder_and_packaged_src_are_equivalent(
project_path=project_path,
package_whole_project_src=True,
parent_output_folder=PARENT_OUTPUT_FOLDER,
contracts=["adder", "multisig"],
)

check_project_folder_and_packaged_src_are_equivalent(
project_path=project_path,
package_whole_project_src=False,
parent_output_folder=PARENT_OUTPUT_FOLDER,
contracts=["adder", "multisig"],
)


def check_project_folder_and_packaged_src_are_equivalent(
project_path: Path,
Expand Down

0 comments on commit 310a0b0

Please sign in to comment.