Complete Rust port with CI/CD pipeline and 100% binary compatibility #4
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: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| test-rust: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| profile: minimal | |
| override: true | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo build | |
| uses: actions/cache@v4 | |
| with: | |
| path: rust/target | |
| key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build Rust project | |
| working-directory: ./rust | |
| run: cargo build --verbose | |
| - name: Run Rust tests | |
| working-directory: ./rust | |
| run: cargo test --verbose | |
| - name: Run Rust baseline test | |
| working-directory: ./rust | |
| run: cargo run --bin test_baseline | |
| test-cpp: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y build-essential cmake | |
| - name: Create build directory | |
| working-directory: ./cpp | |
| run: mkdir -p build | |
| - name: Configure CMake | |
| working-directory: ./cpp/build | |
| run: cmake .. | |
| - name: Build C++ project | |
| working-directory: ./cpp/build | |
| run: make | |
| - name: Run C++ baseline test | |
| working-directory: ./cpp/build | |
| run: ./test_baseline | |
| cross-platform-compatibility: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| profile: minimal | |
| override: true | |
| - name: Build and test Rust (Unix) | |
| if: matrix.os != 'windows-latest' | |
| working-directory: ./rust | |
| run: | | |
| cargo build | |
| cargo test | |
| - name: Build and test Rust (Windows) | |
| if: matrix.os == 'windows-latest' | |
| working-directory: ./rust | |
| run: | | |
| cargo build | |
| cargo test | |
| output-compatibility: | |
| runs-on: ubuntu-latest | |
| needs: [test-rust, test-cpp] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| profile: minimal | |
| override: true | |
| - name: Install C++ dependencies | |
| run: sudo apt-get update && sudo apt-get install -y build-essential cmake | |
| - name: Make comparison script executable | |
| run: chmod +x scripts/compare_outputs.sh | |
| - name: Run output comparison tests | |
| run: ./scripts/compare_outputs.sh |