[Stellar] Rust environment download add release profile (#678) #1
This file contains hidden or 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
name: Test | |
on: | |
push: | |
branches: [master] | |
pull_request: {} | |
jobs: | |
format-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Set up environment | |
uses: ./.github/actions/setup | |
- name: Check formatting | |
run: yarn format:check | |
- name: Run linter | |
run: yarn lint | |
deno-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Set up Deno 1.46.3 (matching Netlify edge function environment) | |
uses: denoland/setup-deno@e95548e56dfa95d4e1a28d6f422fafe75c4c26fb # v2.0.3 | |
with: | |
deno-version: '1.46.3' | |
- name: Set up environment | |
uses: ./.github/actions/setup | |
- name: Deno check API | |
run: yarn type:check:api | |
mcp: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Set up environment | |
uses: ./.github/actions/setup | |
- name: Run tests | |
run: yarn test | |
working-directory: packages/mcp | |
build: | |
name: build (${{ matrix.package }}, ${{ matrix.variant }}) | |
timeout-minutes: 90 | |
strategy: | |
matrix: | |
package: | |
- solidity | |
- cairo | |
- stellar | |
- stylus | |
# This variant config creates 2 branches of the matrix a default and a compile one to run the compile tests in their own job | |
variant: | |
- default | |
- compile | |
exclude: | |
- package: solidity | |
variant: compile | |
- package: cairo | |
variant: compile | |
- package: stylus | |
variant: compile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
with: | |
fetch-depth: 0 | |
- name: Set up environment | |
uses: ./.github/actions/setup | |
# ---------------------------- | |
# Solidity setup | |
- name: Install Foundry | |
if: matrix.package == 'solidity' | |
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de #v1.4.0 | |
# ---------------------------- | |
# Stellar compile setup | |
- name: Cache Rust dependencies | |
if: matrix.package == 'stellar' && matrix.variant == 'compile' | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
runner/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: cargo-${{ matrix.package }} | |
- name: Set up rust toolchain | |
if: matrix.package == 'stellar' && matrix.variant == 'compile' | |
uses: actions-rust-lang/setup-rust-toolchain@2fcdc490d667999e01ddbbf0f2823181beef6b39 # v1.15.0 | |
with: | |
toolchain: stable, nightly | |
components: clippy, rustfmt, llvm-tools-preview | |
target: wasm32v1-none | |
# ---------------------------- | |
- name: Compile TypeScript | |
run: yarn tsc | |
working-directory: packages/core/${{matrix.package}} | |
- name: Check Svelte | |
run: yarn svelte-check | |
working-directory: packages/ui | |
- name: Run tests | |
if: matrix.variant == 'default' | |
run: yarn test '**/*.test.ts' '**/test.ts' '!**/*.compile.test.ts' | |
working-directory: packages/core/${{matrix.package}} | |
- name: Get list of changed files | |
id: filter | |
if: matrix.variant == 'compile' | |
run: | | |
BASE=${{ github.event.pull_request.base.sha || github.event.before }} | |
echo "changes=$(git diff --name-only $BASE ${{ github.sha }} | tr '\n' ' ')" >> $GITHUB_OUTPUT | |
- name: Run tests | |
if: matrix.variant == 'compile' && contains(steps.filter.outputs.changes, format('packages/core/{0}/', matrix.package)) | |
env: | |
RUSTFLAGS: "" | |
run: | | |
FILES=$(find ./ -type f -name '*.compile.test.ts') | |
if [ -z "$FILES" ]; then | |
echo "No compile tests found. Skipping." | |
exit 0 | |
else | |
yarn test '**/*.compile.test.ts' | |
fi | |
working-directory: packages/core/${{matrix.package}} |