diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9ed5643..97d5d63 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -12,12 +12,17 @@ env: jobs: ubuntu-build: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, ubuntu-24.04-arm] + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - name: Install llvm - run: sudo apt update && sudo apt install -y clang # This requires Ubuntu 24.04 or later + run: sudo apt update && sudo apt install -y clang llvm # This requires Ubuntu 24.04 or later + - uses: actions-rust-lang/setup-rust-toolchain@v1 - name: Install cargo generate run: cargo install cargo-generate - name: Generate workspace @@ -50,36 +55,6 @@ jobs: - name: Reproducible build runs run: cd test-contract && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean - ubuntu-arm64-docker-build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Setup qemu binfmt - run: docker run --privileged --rm tonistiigi/binfmt --install all - - name: Install cargo generate - run: cargo install cargo-generate - - name: Generate workspace - run: cargo generate --path . workspace --name test-workspace - - name: Generate crates && contracts - run: cd test-workspace && - make generate CRATE=clib TEMPLATE=c-wrapper-crate DESTINATION=crates TEMPLATE_TYPE=--path TEMPLATE_REPO=.. && - make generate CRATE=rlib TEMPLATE=x64-simulator-crate DESTINATION=crates TEMPLATE_TYPE=--path TEMPLATE_REPO=.. && - make generate CRATE=c1 TEMPLATE=contract TEMPLATE_TYPE=--path TEMPLATE_REPO=.. && - make generate CRATE=c2 TEMPLATE=atomics-contract TEMPLATE_TYPE=--path TEMPLATE_REPO=.. && - make generate CRATE=c3 TEMPLATE=stack-reorder-contract TEMPLATE_TYPE=--path TEMPLATE_REPO=.. - - name: Submodules - run: cd test-workspace && - git submodule add https://github.com/nervosnetwork/ckb-c-stdlib deps/ckb-c-stdlib && - git submodule add https://github.com/xxuejie/lib-dummy-atomics deps/lib-dummy-atomics - - name: Reproducible build runs - run: cd test-workspace && export DOCKER_RUN_ARGS="--platform linux/arm64" && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean - - name: Generate standalone contract - run: cargo generate --path . standalone-contract --name test-contract - - name: Reproducible build runs - run: cd test-contract && export DOCKER_RUN_ARGS="--platform linux/arm64" && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean - debian-build: runs-on: ubuntu-latest diff --git a/atomics-contract/Cargo.toml b/atomics-contract/Cargo.toml index 8df89c6..2d07910 100644 --- a/atomics-contract/Cargo.toml +++ b/atomics-contract/Cargo.toml @@ -9,3 +9,6 @@ log = { version = "0.4.20", default-features = false } [build-dependencies] cc = "1.0" + +[features] +native-simulator = ["ckb-std/native-simulator"] diff --git a/stack-reorder-contract/Cargo.toml b/stack-reorder-contract/Cargo.toml index 3e8da71..4eb9d81 100644 --- a/stack-reorder-contract/Cargo.toml +++ b/stack-reorder-contract/Cargo.toml @@ -8,3 +8,6 @@ ckb-std = "0.16.3" [build-dependencies] cc = "1.0" + +[features] +native-simulator = ["ckb-std/native-simulator"] diff --git a/standalone-contract/Cargo.toml b/standalone-contract/Cargo.toml index 41c130e..fa38ccf 100644 --- a/standalone-contract/Cargo.toml +++ b/standalone-contract/Cargo.toml @@ -9,3 +9,6 @@ ckb-std = "0.16.3" [dev-dependencies] ckb-testtool = "0.14.0" serde_json = "1.0" + +[features] +native-simulator = ["ckb-std/native-simulator"]