Skip to content

Merge pull request #134 from mxllv/feat/issue-115-escrow-contract-bal… #4

Merge pull request #134 from mxllv/feat/issue-115-escrow-contract-bal…

Merge pull request #134 from mxllv/feat/issue-115-escrow-contract-bal… #4

Workflow file for this run

name: Veritix Pay CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-and-test:
name: Build, Test, and Format
runs-on: ubuntu-latest
# Set the working directory for all run steps in this job
defaults:
run:
working-directory: veritixpay/contract/token
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.84.0"
targets: wasm32-unknown-unknown
components: rustfmt, clippy
- name: Cache Cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: "veritixpay/contract/token -> target"
- name: Install Stellar CLI
run: cargo install --locked stellar-cli
- name: Check for orphaned source files
run: |
LIB=src/lib.rs
EXIT=0
for f in src/*.rs; do
mod=$(basename "$f" .rs)
[ "$mod" = "lib" ] && continue
if ! grep -qE "^\s*(pub\s+)?mod\s+${mod}\s*;" "$LIB"; then
echo "ORPHAN: $f is not declared in lib.rs"
EXIT=1
fi
done
exit $EXIT
- name: Check Formatting
# Uses cargo fmt directly, or make fmt if it passes the args in your Makefile
run: cargo fmt -- --check
- name: Run Clippy
run: cargo clippy --lib -- -D warnings
- name: Build Contract
run: make build
- name: Run Tests
run: make test