Merge pull request #123 from success-OG/feat/secrets #31
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: Contract CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "contract/**" | |
| - ".github/workflows/**" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "contract/**" | |
| jobs: | |
| contract-ci: | |
| name: Smart Contract Checks | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: contract | |
| steps: | |
| # ----------------------------- | |
| # Checkout repository | |
| # ----------------------------- | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # ----------------------------- | |
| # Set up Rust toolchain | |
| # ----------------------------- | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| components: rustfmt, clippy | |
| # ----------------------------- | |
| # Cache cargo dependencies | |
| # ----------------------------- | |
| - name: Cache Cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| contract/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('contract/**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| # ----------------------------- | |
| # Formatting check | |
| # ----------------------------- | |
| - name: Cargo format check | |
| run: cargo fmt --all -- --check | |
| # ----------------------------- | |
| # Build contracts | |
| # ----------------------------- | |
| - name: Cargo build | |
| run: cargo build --locked | |
| # ----------------------------- | |
| # Run tests | |
| # ----------------------------- | |
| - name: Cargo test | |
| run: cargo test --locked | |
| # ----------------------------- | |
| # Clippy linting | |
| # ----------------------------- | |
| - name: Cargo clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings |