Skip to content

Commit 9c61f6a

Browse files
authored
Merge pull request #26 from cryptape/native-arm64-ci
Use native arm64 ci
2 parents 73cbb47 + 9938e0c commit 9c61f6a

File tree

4 files changed

+16
-32
lines changed

4 files changed

+16
-32
lines changed

.github/workflows/rust.yml

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ env:
1212
jobs:
1313
ubuntu-build:
1414

15-
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, ubuntu-24.04-arm]
18+
19+
runs-on: ${{ matrix.os }}
1620

1721
steps:
1822
- uses: actions/checkout@v3
1923
- name: Install llvm
20-
run: sudo apt update && sudo apt install -y clang # This requires Ubuntu 24.04 or later
24+
run: sudo apt update && sudo apt install -y clang llvm # This requires Ubuntu 24.04 or later
25+
- uses: actions-rust-lang/setup-rust-toolchain@v1
2126
- name: Install cargo generate
2227
run: cargo install cargo-generate
2328
- name: Generate workspace
@@ -50,36 +55,6 @@ jobs:
5055
- name: Reproducible build runs
5156
run: cd test-contract && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean
5257

53-
ubuntu-arm64-docker-build:
54-
55-
runs-on: ubuntu-latest
56-
57-
steps:
58-
- uses: actions/checkout@v3
59-
- name: Setup qemu binfmt
60-
run: docker run --privileged --rm tonistiigi/binfmt --install all
61-
- name: Install cargo generate
62-
run: cargo install cargo-generate
63-
- name: Generate workspace
64-
run: cargo generate --path . workspace --name test-workspace
65-
- name: Generate crates && contracts
66-
run: cd test-workspace &&
67-
make generate CRATE=clib TEMPLATE=c-wrapper-crate DESTINATION=crates TEMPLATE_TYPE=--path TEMPLATE_REPO=.. &&
68-
make generate CRATE=rlib TEMPLATE=x64-simulator-crate DESTINATION=crates TEMPLATE_TYPE=--path TEMPLATE_REPO=.. &&
69-
make generate CRATE=c1 TEMPLATE=contract TEMPLATE_TYPE=--path TEMPLATE_REPO=.. &&
70-
make generate CRATE=c2 TEMPLATE=atomics-contract TEMPLATE_TYPE=--path TEMPLATE_REPO=.. &&
71-
make generate CRATE=c3 TEMPLATE=stack-reorder-contract TEMPLATE_TYPE=--path TEMPLATE_REPO=..
72-
- name: Submodules
73-
run: cd test-workspace &&
74-
git submodule add https://github.com/nervosnetwork/ckb-c-stdlib deps/ckb-c-stdlib &&
75-
git submodule add https://github.com/xxuejie/lib-dummy-atomics deps/lib-dummy-atomics
76-
- name: Reproducible build runs
77-
run: cd test-workspace && export DOCKER_RUN_ARGS="--platform linux/arm64" && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean
78-
- name: Generate standalone contract
79-
run: cargo generate --path . standalone-contract --name test-contract
80-
- name: Reproducible build runs
81-
run: cd test-contract && export DOCKER_RUN_ARGS="--platform linux/arm64" && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean
82-
8358
debian-build:
8459

8560
runs-on: ubuntu-latest

atomics-contract/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ log = { version = "0.4.20", default-features = false }
99

1010
[build-dependencies]
1111
cc = "1.0"
12+
13+
[features]
14+
native-simulator = ["ckb-std/native-simulator"]

stack-reorder-contract/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ ckb-std = "0.16.3"
88

99
[build-dependencies]
1010
cc = "1.0"
11+
12+
[features]
13+
native-simulator = ["ckb-std/native-simulator"]

standalone-contract/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ ckb-std = "0.16.3"
99
[dev-dependencies]
1010
ckb-testtool = "0.14.0"
1111
serde_json = "1.0"
12+
13+
[features]
14+
native-simulator = ["ckb-std/native-simulator"]

0 commit comments

Comments
 (0)