neo4rs 0.9.0-rc.10 #645
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 | |
| permissions: | |
| contents: read | |
| 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_include_snippet | |
| - neo4rs-macros | |
| env: | |
| RUST_LOG: debug | |
| CARGO_TERM_COLOR: always | |
| MSRV: 1.81.0 | |
| HACK_OPTS: --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 +${{ env.MSRV }} --locked hack --package neo4rs ${{ env.HACK_OPTS }} 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 +${{ env.MSRV }} --locked hack --package neo4rs ${{ env.HACK_OPTS }} 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 hack ${{ env.HACK_OPTS }} nextest --manifest-path './integrationtests/Cargo.toml' 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 +${{ env.MSRV }} nextest run --package neo4rs --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' }} |