Skip to content
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
34 changes: 20 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Install llvm 16
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 16 && rm llvm.sh
- name: Install riscv64 target
run: rustup target add riscv64imac-unknown-none-elf
- name: Install llvm 18
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18 && rm llvm.sh
- name: Install cargo generate
run: cargo install cargo-generate
- name: Generate workspace
Expand All @@ -35,14 +33,22 @@ jobs:
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: Lock Rust version
run: cd test-workspace && echo "1.75.0" > rust-toolchain
- name: Install riscv64 target
run: cd test-workspace && rustup target add riscv64imac-unknown-none-elf
# TODO: Ubuntu 24.04 ships a clang package with clang, clang-18 and llvm-ar-18, while fedora ships a clang package with
# clang, clang-19 and llvm-ar. We will need to deal with this quirk between different distros.
- name: Run all checks
run: cd test-workspace && make build test check clippy
run: cd test-workspace && CLANG=clang-18 make build test check clippy
- name: Reproducible build runs
run: cd test-workspace && ./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: Lock Rust version
run: cd test-contract && echo "1.75.0" > rust-toolchain
- name: Run all checks
run: cd test-contract && make build test check clippy
run: cd test-contract && CLANG=clang-18 make build test check clippy
- name: Reproducible build runs
run: cd test-contract && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean

Expand Down Expand Up @@ -87,8 +93,8 @@ jobs:
steps:
- name: Install dependencies
run: apt-get update && apt-get -y install curl git build-essential pkg-config libssl-dev lsb-release wget software-properties-common gnupg
- name: Install llvm 16
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 && rm llvm.sh
- name: Install llvm 18
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 18 && rm llvm.sh
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
Expand Down Expand Up @@ -206,8 +212,8 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install llvm 16
run: brew install llvm@16
- name: Install llvm 18
run: brew install llvm@18
- name: Install riscv64 target
run: rustup target add riscv64imac-unknown-none-elf
- name: Install cargo generate
Expand Down Expand Up @@ -250,8 +256,8 @@ jobs:
# submodules: true
# - name: Setup Docker on macOS
# run: brew install docker colima && colima start
# - name: Install llvm 16
# run: brew install llvm@16
# - name: Install llvm 18
# run: brew install llvm@18
# - name: Install riscv64 target
# run: rustup target add riscv64imac-unknown-none-elf
# - name: Install cargo generate
Expand Down Expand Up @@ -288,7 +294,7 @@ jobs:
shell: pwsh
# https://github.com/ScoopInstaller/Install#for-admin
#
# Note that on Windows we cannot choose LLVM 16 here, we have to settle on latest stable LLVM
# Note that on Windows we cannot choose LLVM 18 here, we have to settle on latest stable LLVM
run: |
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
scoop install llvm yasm
Expand Down Expand Up @@ -331,7 +337,7 @@ jobs:
usesh: true
prepare: |
set -ex
pkg install -y llvm16 git gmake bash
pkg install -y llvm18 git gmake bash
curl https://sh.rustup.rs -sSf | sh -s -- -y
. $HOME/.cargo/env
rustup target add riscv64imac-unknown-none-elf
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ This repository keeps a series of CKB script templates that can be inflated via

The following dependencies are required for the templates:

* `git`, `make`, `sed`, `bash`, `sha256sum` and others Unix utilities. Refer to the documentation for your operating systems for how to install them. Chances are your system might already have them.
* `git`, `make`, `sed`, `bash`, `shasum` and others Unix utilities. Refer to the documentation for your operating systems for how to install them. Chances are your system might already have them.
* `Rust`: latest stable Rust installed via [rustup](https://rustup.rs/) should work. Make sure you have `riscv64` target installed via: `rustup target add riscv64imac-unknown-none-elf`
* `Clang`: make sure you have clang 16+ installed, sample installtion steps for selected platforms are:
+ Debian / Ubuntu: `wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 16 && rm llvm.sh`
* `Clang`: make sure you have clang 18+ installed, sample installtion steps for selected platforms are:
+ Debian / Ubuntu: `wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18 && rm llvm.sh`
+ Fedora 39+: `sudo dnf -y install clang`
+ Archlinux: `sudo pacman --noconfirm -Syu clang`
+ macOS: `brew install llvm@16`
+ macOS: `brew install llvm@18`
+ Windows(with [Scoop](scoop install llvm yasm)): `scoop install llvm yasm`
* `cargo-generate`: You can install this via `cargo install cargo-generate`, or follow the steps [here](https://cargo-generate.github.io/cargo-generate/installation.html)

Expand Down
Loading