Merge pull request #19 from rohansen856/feat/skip-range-check #114
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: Rust CI/CD Pipeline | |
| on: | |
| push: | |
| branches: '**' | |
| pull_request: | |
| branches: '**' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check: | |
| name: Lint, Format & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: 🦀 Set up Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| components: clippy, rustfmt | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: 📦 Install dependencies | |
| run: cargo fetch | |
| - name: 🔍 Type check | |
| run: cargo check --all --all-targets | |
| - name: 🧹 Run formatter (cargo fmt) | |
| run: cargo fmt --all --check | |
| - name: 🔎 Run Clippy (Linter) | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: 🧪 Run unit tests | |
| run: cargo test --lib --verbose | |
| - name: 🔧 Run integration tests | |
| run: cargo test --test integration_tests --verbose | |
| - name: 🚀 Run all tests | |
| run: cargo test --verbose | |
| cross-build: | |
| name: Cross Compile Binaries | |
| needs: check | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: 🦀 Set up Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| components: clippy, rustfmt | |
| - name: Install cross (only for Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: cargo install cross --locked | |
| - name: Build (Native) | |
| run: cargo build --release | |
| - name: Save artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binary-${{ matrix.os }} | |
| path: | | |
| target/release/git-editor | |
| target/release/git-editor.exe |