Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native arm64 ci #26

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading