Skip to content

Commit

Permalink
Fix macOS CI
Browse files Browse the repository at this point in the history
  • Loading branch information
xxuejie committed Jul 1, 2024
1 parent 9629bed commit 13b5e42
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,51 @@ jobs:
run: brew install llvm@16
- name: Install coreutils
run: brew install coreutils
- name: Install docker
run: rustup target add riscv64imac-unknown-none-elf
- 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: Run all checks
run: cd test-workspace && make build test check clippy
- name: Generate standalone contract
run: cargo generate --path . standalone-contract --name test-contract
- name: Run all checks
run: cd test-contract && make build test check clippy

# For now, github action's latest arm64-based macos runner does not support docker. We will have to
# Use an order version for now to test reproducible build on macOS. Maybe when macOS 15 is out we can
# re-test later.
#
# References:
# * https://github.com/orgs/community/discussions/69211
# * https://github.com/marketplace/actions/setup-docker-on-macos
macos-x64-reproducible-build:

runs-on: macos-13

steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Docker on macOS
uses: douglascamata/setup-docker-macos-action@v1-alpha
- name: Install llvm 16
run: brew install llvm@16
- name: Install coreutils
run: brew install coreutils
- name: Install riscv64 target
run: rustup target add riscv64imac-unknown-none-elf
- name: Install cargo generate
Expand Down

0 comments on commit 13b5e42

Please sign in to comment.