Skip to content

Commit 2d749c7

Browse files
authored
Experimental FreeBSD CI (#2)
* Update rust.yml * Update rust.yml * Update rust.yml * Update rust.yml * Update rust.yml * Update rust.yml * Use MAKE environment variable to deal with different make command gmake on FreeBSD for example, requires MAKE env variable to invoke
1 parent 4ddf46c commit 2d749c7

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

.github/workflows/rust.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,40 @@ jobs:
196196
run: cargo generate --path . standalone-contract --name test-contract
197197
- name: Run all checks
198198
run: cd test-contract && make build test check clippy
199+
200+
freebsd-build:
201+
202+
runs-on: ubuntu-latest
203+
204+
steps:
205+
- uses: actions/checkout@v3
206+
with:
207+
submodules: true
208+
- name: Build in FreeBSD VM
209+
uses: vmactions/freebsd-vm@v1
210+
with:
211+
usesh: true
212+
prepare: |
213+
set -ex
214+
pkg install -y llvm16 git gmake bash
215+
curl https://sh.rustup.rs -sSf | sh -s -- -y
216+
. $HOME/.cargo/env
217+
rustup target add riscv64imac-unknown-none-elf
218+
cargo install cargo-generate
219+
run: |
220+
set -ex
221+
. $HOME/.cargo/env
222+
cargo generate --path . standalone-contract --name test-contract
223+
cd test-contract
224+
gmake build test check clippy
225+
cd ..
226+
cargo generate --path . workspace --name test-workspace
227+
cd test-workspace
228+
gmake generate CRATE=clib TEMPLATE=c-wrapper-crate DESTINATION=crates TEMPLATE_TYPE=--path TEMPLATE_REPO=..
229+
gmake generate CRATE=rlib TEMPLATE=x64-simulator-crate DESTINATION=crates TEMPLATE_TYPE=--path TEMPLATE_REPO=..
230+
gmake generate CRATE=c1 TEMPLATE=contract TEMPLATE_TYPE=--path TEMPLATE_REPO=..
231+
gmake generate CRATE=c2 TEMPLATE=atomics-contract TEMPLATE_TYPE=--path TEMPLATE_REPO=..
232+
gmake generate CRATE=c3 TEMPLATE=stack-reorder-contract TEMPLATE_TYPE=--path TEMPLATE_REPO=..
233+
git submodule add https://github.com/nervosnetwork/ckb-c-stdlib deps/ckb-c-stdlib
234+
git submodule add https://github.com/xxuejie/lib-dummy-atomics deps/lib-dummy-atomics
235+
gmake build test check clippy

workspace/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ build:
4242
@set -eu; \
4343
if [ "x$(CONTRACT)" = "x" ]; then \
4444
for contract in $(wildcard contracts/*); do \
45-
make -e -C $$contract build; \
45+
$(MAKE) -e -C $$contract build; \
4646
done; \
4747
else \
48-
make -e -C contracts/$(CONTRACT) build; \
48+
$(MAKE) -e -C contracts/$(CONTRACT) build; \
4949
fi
5050

5151
# Run a single make task for a specific contract. For example:
5252
#
5353
# make run CONTRACT=stack-reorder TASK=adjust_stack_size STACK_SIZE=0x200000
5454
TASK :=
5555
run:
56-
make -e -C contracts/$(CONTRACT) $(TASK)
56+
$(MAKE) -e -C contracts/$(CONTRACT) $(TASK)
5757

5858
# test, check, clippy and fmt here are provided for completeness,
5959
# there is nothing wrong invoking cargo directly instead of make.

0 commit comments

Comments
 (0)