ci: limit Github Workflow to formatting and unit tests #11
Workflow file for this run
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: Check PR | |
| on: | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| NF4_LARGE_BLOCK_TEST: "true" | |
| jobs: | |
| build: | |
| name: Check + Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Correct, CI-safe Foundry install | |
| - name: Install Foundry (forge, cast) - needed by build.rs | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: nightly | |
| - name: Verify forge | |
| run: | | |
| which forge | |
| forge --version | |
| - name: Install Rust nightly with rustfmt & clippy | |
| shell: bash | |
| run: | | |
| rustup toolchain install nightly | |
| rustup +nightly component add rustfmt clippy | |
| - name: Setup Node.js (for upgrades-core validator) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install upgrades-core globally and verify npx | |
| shell: bash | |
| run: | | |
| npm i -g @openzeppelin/upgrades-core@^1.37.0 | |
| node -v | |
| npm -v | |
| npx --version | |
| - name: Run cargo fmt | |
| run: cargo +nightly fmt | |
| - name: Run clippy | |
| run: cargo +nightly clippy --all-targets -- -D warnings | |
| - name: Generate keys | |
| run: | | |
| cargo build | |
| cargo run --release --bin key_generation | |
| - name: Run test | |
| run: cargo test | |
| forge: | |
| name: Smart Contract Unit Tests | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Same action here (jobs do not share state) | |
| - name: Install Foundry (forge, cast) | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: nightly | |
| - name: Run Forge Tests | |
| run: forge test |