Skip to content

Commit

Permalink
Merge pull request #26 from cryptape/native-arm64-ci
Browse files Browse the repository at this point in the history
Use native arm64 ci
  • Loading branch information
xxuejie authored Jan 21, 2025
2 parents 73cbb47 + 9938e0c commit 9c61f6a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 32 deletions.
39 changes: 7 additions & 32 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions atomics-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ log = { version = "0.4.20", default-features = false }

[build-dependencies]
cc = "1.0"

[features]
native-simulator = ["ckb-std/native-simulator"]
3 changes: 3 additions & 0 deletions stack-reorder-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ ckb-std = "0.16.3"

[build-dependencies]
cc = "1.0"

[features]
native-simulator = ["ckb-std/native-simulator"]
3 changes: 3 additions & 0 deletions standalone-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 9c61f6a

Please sign in to comment.