Skip to content

Commit bebe010

Browse files
CoveMBericglau
andauthored
[Stellar] Add rust ci compilation (#594)
Co-authored-by: Eric Lau <[email protected]>
1 parent 555b43a commit bebe010

12 files changed

+1144
-631
lines changed

.github/workflows/test.yml

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
working-directory: packages/mcp
4242

4343
build:
44+
name: build (${{ matrix.package }}, ${{ matrix.variant }})
4445
timeout-minutes: 90
4546
strategy:
4647
matrix:
@@ -49,6 +50,10 @@ jobs:
4950
- cairo
5051
- stellar
5152
- stylus
53+
# This variant config creates 2 branches of the matrix a default and a compile one to run the compile tests in their own job
54+
variant:
55+
- default
56+
- compile
5257

5358
runs-on: ubuntu-latest
5459
steps:
@@ -63,45 +68,29 @@ jobs:
6368
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de #v1.4.0
6469

6570
# ----------------------------
66-
# Stellar setup
71+
# Stellar compile setup
6772

68-
- name: Free up disk space
69-
if: matrix.package == 'stellar'
70-
run: |
71-
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android
72-
df -h
73-
74-
# - name: Get scaffold-stellar latest commit SHA
75-
# if: matrix.package == 'stellar'
76-
# id: get-scaffold-sha
77-
# run: |
78-
# echo "sha=$(git ls-remote https://github.com/ahalabs/scaffold-stellar HEAD | cut -f1)" >> $GITHUB_OUTPUT
79-
80-
# - name: Cache Scaffold CLIs
81-
# if: matrix.package == 'stellar'
82-
# uses: actions/cache@v4
83-
# with:
84-
# path: |
85-
# ~/.cargo/bin/
86-
# ~/.cargo/registry/index/
87-
# ~/.cargo/registry/cache/
88-
# ~/.cargo/git/db/
89-
# key: cargo-scaffold-${{ matrix.package }}-${{ steps.get-scaffold-sha.outputs.sha }}
90-
# restore-keys: |
91-
# cargo-scaffold-${{ matrix.package }}-
92-
# cargo-scaffold-
93-
# cargo-scaffold-
73+
- name: Cache Rust dependencies
74+
if: matrix.package == 'stellar' && matrix.variant == 'compile'
75+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
76+
with:
77+
path: |
78+
~/.cargo/bin/
79+
runner/.cargo/bin/
80+
~/.cargo/registry/index/
81+
~/.cargo/registry/cache/
82+
~/.cargo/git/db/
83+
target/
84+
key: cargo-${{ matrix.package }}
9485

95-
# - name: Set up rust toolchain
96-
# uses: actions-rust-lang/setup-rust-toolchain@v1
97-
# with:
98-
# toolchain: stable, nightly
99-
# components: clippy, rustfmt, llvm-tools-preview
100-
# target: wasm32v1-none
10186

102-
# - name: Set up Stellar CLI
103-
# if: matrix.package == 'stellar'
104-
# uses: stellar/[email protected]
87+
- name: Set up rust toolchain
88+
if: matrix.package == 'stellar' && matrix.variant == 'compile'
89+
uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 #v1.13.0
90+
with:
91+
toolchain: stable, nightly
92+
components: clippy, rustfmt, llvm-tools-preview
93+
target: wasm32v1-none
10594

10695
# ----------------------------
10796
- name: Compile TypeScript
@@ -111,5 +100,20 @@ jobs:
111100
run: yarn svelte-check
112101
working-directory: packages/ui
113102
- name: Run tests
114-
run: yarn test
103+
if: matrix.variant == 'default'
104+
run: yarn test '**/*.test.ts' '!**/*.compile.test.ts'
105+
working-directory: packages/core/${{matrix.package}}
106+
107+
- name: Run tests
108+
if: matrix.variant == 'compile'
109+
env:
110+
RUSTFLAGS: ""
111+
run: |
112+
FILES=$(find ./ -type f -name '*.compile.test.ts')
113+
if [ -z "$FILES" ]; then
114+
echo "No compile tests found. Skipping."
115+
exit 0
116+
else
117+
yarn test '**/*.compile.test.ts'
118+
fi
115119
working-directory: packages/core/${{matrix.package}}

packages/core/solidity/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
"include": [
1414
"src/**/*"
1515
]
16-
}
16+
}

0 commit comments

Comments
 (0)