feat: harden backend and frontend security #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 Contracts | |
| on: | |
| pull_request: | |
| paths: | |
| - "contracts/**" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "contracts/**" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| . -> target | |
| - name: Build all contracts | |
| run: cargo build --target wasm32-unknown-unknown --release | |
| - name: Run contract unit tests | |
| run: cargo test -- --nocapture | |
| - name: Check formatting | |
| run: cargo fmt --check || echo "Run 'cargo fmt' to fix formatting" |