mark pre release as false #20
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 TSP Solver | |
| on: [push, pull_request] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| name: Test - ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry (Unix) | |
| if: runner.os != 'Windows' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Cache cargo registry (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| %USERPROFILE%\.cargo\bin | |
| %USERPROFILE%\.cargo\registry\index | |
| %USERPROFILE%\.cargo\registry\cache | |
| %USERPROFILE%\.cargo\git\db | |
| target\ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Build | |
| run: cargo build --release | |
| - name: Run tests | |
| run: cargo test --release | |
| - name: Test with 5 cities | |
| run: cargo run --release -- 5 42 | |
| - name: Test with 7 cities | |
| run: cargo run --release -- 7 123 | |
| - name: Test with 10 cities (with threads) | |
| run: cargo run --release -- 10 42 4 | |
| - name: Verify binary exists | |
| shell: bash | |
| run: | | |
| # Get the actual binary name from Cargo.toml | |
| BINARY_NAME=$(grep -m1 '^name' Cargo.toml | sed 's/.*"\(.*\)".*/\1/' | tr '-' '_') | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then | |
| if test -f "target/release/${BINARY_NAME}.exe"; then | |
| echo "✓ Binary found: ${BINARY_NAME}.exe" | |
| else | |
| echo "✗ Binary not found: ${BINARY_NAME}.exe" | |
| exit 1 | |
| fi | |
| else | |
| if test -f "target/release/${BINARY_NAME}"; then | |
| echo "✓ Binary found: ${BINARY_NAME}" | |
| else | |
| echo "✗ Binary not found: ${BINARY_NAME}" | |
| exit 1 | |
| fi | |
| fi | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - run: cargo clippy -- -D warnings | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --all -- --check |