-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from radixdlt/update/switch_to_bottlenose
- Loading branch information
Showing
4 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: 'Setup environment' | ||
description: 'Common GH action to setup job environment' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install Rust toolchain | ||
uses: RDXWorks-actions/toolchain@master | ||
with: | ||
toolchain: 1.77.2 | ||
default: true | ||
target: wasm32-unknown-unknown | ||
components: rustfmt | ||
|
||
- name: Install nextest | ||
uses: RDXWorks-actions/install-action@nextest | ||
|
||
- name: Set LIBCLANG_PATH # See https://github.com/rust-lang/rust-bindgen/issues/1797 | ||
if: runner.os == 'Windows' | ||
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV | ||
shell: bash | ||
- name: Install dependencies | ||
if: runner.os == 'Windows' | ||
run: choco install llvm -y | ||
shell: bash | ||
- name: Setup cmake | ||
if: runner.os == 'Linux' | ||
uses: RDXWorks-actions/actions-setup-cmake@master | ||
with: | ||
cmake-version: '3.27.9' | ||
- name: Install libclang-dev | ||
if: runner.os == 'Linux' | ||
run: sudo apt-get -y update && sudo apt-get install clang libclang-dev -y -f | ||
shell: bash | ||
- name: Setup LLVM | ||
if: runner.os == 'macOS' | ||
# Switch to more recent LLVM/Clang 15.0.7 | ||
# see: https://github.com/actions/runner-images/blob/macOS-12/20240105.3/images/macos/macos-12-Readme.md | ||
run: echo "$(brew --prefix llvm@15)/bin" >> $GITHUB_PATH | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-examples: | ||
name: Build examples | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- uses: RDXWorks-actions/checkout@main | ||
- name: Setup environment | ||
uses: ./.github/actions/setup-env | ||
- name: Run tests | ||
run: bash ./build_examples.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
radixdlt-scrypto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
tag=bottlenose-9396c507 | ||
|
||
fetch_scrypto() { | ||
if [ ! -d radixdlt-scrypto ] ; then | ||
mkdir radixdlt-scrypto | ||
pushd radixdlt-scrypto | ||
git init | ||
git remote add origin https://github.com/radixdlt/radixdlt-scrypto.git | ||
git fetch --depth 1 origin $tag | ||
git checkout FETCH_HEAD | ||
popd | ||
fi | ||
} | ||
|
||
build_scrypto() { | ||
cargo build --manifest-path radixdlt-scrypto/radix-clis/Cargo.toml | ||
} | ||
|
||
build_examples() { | ||
scrypto="cargo run --manifest-path radixdlt-scrypto/radix-clis/Cargo.toml --bin scrypto $@ --" | ||
|
||
# Get Cargo.toml for each example (those with [package] marker). | ||
# Exclude: | ||
# - radixdlt-scrypto | ||
# - examples, which won't buiild by design | ||
find . \( \ | ||
-path './radixdlt-scrypto' -o \ | ||
-path './step-by-step/18-candy-store-external-component/2-candy-store' \ | ||
\) -prune \ | ||
-o -name Cargo.toml -print | xargs grep -l '\[package]' | while read path ; do | ||
|
||
echo "Building $(dirname $path)" | ||
$scrypto build --path $path | ||
cargo clean --manifest-path $path | ||
done | ||
} | ||
|
||
fetch_scrypto | ||
|
||
build_scrypto | ||
|
||
build_examples |