Move ITs into their own crate #600
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: checks | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| release: | |
| types: [ published ] | |
| merge_group: | |
| workflow_dispatch: | |
| inputs: | |
| crate: | |
| description: Which crate to publish | |
| required: true | |
| type: choice | |
| options: | |
| - neo4rs | |
| - neo4rs-macros | |
| env: | |
| RUST_LOG: debug | |
| CARGO_TERM_COLOR: always | |
| MSRV: 1.85.0 | |
| HACK: hack --package neo4rs --each-feature --exclude-features unstable-serde-packstream-format,unstable-bolt-protocol-impl-v2,unstable-result-summary | |
| jobs: | |
| fmt: | |
| name: Check formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| - name: Set up Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo fmt | |
| run: cargo +stable fmt --all -- --check | |
| clippy: | |
| name: Check clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.MSRV }} | |
| components: clippy | |
| - name: Set up Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-hack | |
| uses: taiki-e/install-action@cargo-hack | |
| - name: Prepare MSRV lockfile | |
| run: cp ci/Cargo.lock.msrv Cargo.lock | |
| - name: Run clippy | |
| run: cargo +$MSRV --locked ${{ env.HACK }} clippy -- -D warnings | |
| unit-tests: | |
| name: Run unit tests | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ windows-latest, macOS-latest, ubuntu-latest ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.MSRV }} | |
| - name: Set up Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-hack | |
| uses: taiki-e/install-action@cargo-hack | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@nextest | |
| - name: Prepare MSRV lockfile | |
| run: cp ci/Cargo.lock.msrv Cargo.lock | |
| - name: Run unit tests | |
| run: cargo +$MSRV --locked ${{ env.HACK }} nextest run --lib | |
| integration-tests: | |
| name: Run integration tests | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| neo4j: [ "2025", "5", "4.4" ] | |
| runs-on: ubuntu-latest | |
| services: | |
| neo4j: | |
| image: neo4j:${{ matrix.neo4j }}-enterprise | |
| env: | |
| NEO4J_ACCEPT_LICENSE_AGREEMENT: yes | |
| NEO4J_AUTH: neo4j/integrationtest | |
| ports: | |
| - "7687:7687" | |
| env: | |
| NEO4J_TEST_URI: bolt://localhost:7687 | |
| NEO4J_TEST_USER: neo4j | |
| NEO4J_TEST_PASS: integrationtest | |
| NEO4J_VERSION_TAG: ${{ matrix.neo4j }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: Set up Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-hack | |
| uses: taiki-e/install-action@cargo-hack | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@nextest | |
| - name: Run integration tests | |
| run: cargo {{ env.HACK }} nextest run -E 'kind(test)' | |
| min_dep: | |
| name: Validate minimal dependency versions | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.MSRV }} | |
| - name: Set up Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@nextest | |
| - name: Prepare minimal dependency versions lockfile | |
| run: cp ci/Cargo.lock.min Cargo.lock | |
| - name: Run minimal dependency versions unit tests | |
| run: cargo +$MSRV nextest --package neo4rs run --lib --all-features --locked | |
| release: | |
| name: Release | |
| needs: [ fmt, clippy, unit-tests, integration-tests, min_dep ] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: Set up Rust cache | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Publish release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| run: cargo publish -p ${{ inputs.crate || 'neo4rs' }} |