makehappy: fmt, clippy #7
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: rustfmt, clippy | |
| - name: Build | |
| run: cargo build | |
| - name: Run tests | |
| run: cargo test | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Run clippy | |
| run: cargo clippy -- -D warnings | |
| requirements-setup-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: rustfmt, clippy | |
| - name: Build | |
| run: cargo build | |
| - name: Test requirements-checker with --setup | |
| run: | | |
| cargo run -- requirements-checker --setup | |
| continue-on-error: false | |
| build-commands-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Build | |
| run: cargo build | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker builder image | |
| run: docker build -t foc-localnet-builder ./docker | |
| - name: Verify Docker image was built | |
| run: docker images foc-localnet-builder | |
| - name: Test build command with invalid path (should fail gracefully) | |
| run: | | |
| if ./target/debug/foc-localnet build lotus /nonexistent/path 2>&1; then | |
| echo "Expected command to fail with nonexistent path" | |
| exit 1 | |
| fi | |
| - name: Test Lotus build command (with timeout to avoid long builds) | |
| run: | | |
| # Test the build command with a timeout to avoid excessive CI time | |
| # This will test the cloning and Docker setup without full build | |
| timeout 600 ./target/debug/foc-localnet build lotus || echo "Build timed out or failed as expected" | |
| - name: Test Curio build command (with timeout to avoid long builds) | |
| run: | | |
| # Test the build command with a timeout to avoid excessive CI time | |
| # This will test the cloning and Docker setup without full build | |
| timeout 600 ./target/debug/foc-localnet build curio || echo "Build timed out or failed as expected" | |
| - name: Check if any output was generated | |
| run: | | |
| echo "Contents of test-output directory:" | |
| ls -la test-output/ || echo "No output directory found" | |
| echo "Contents of ~/.foc-localnet/bin/ if it exists:" | |
| ls -la ~/.foc-localnet/bin/ 2>/dev/null || echo "Default output directory not found" |