Split Neo4j type into builder and image (#7) #24
This file contains 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 | |
merge_group: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
RUST_LOG: debug | |
CARGO_TERM_COLOR: always | |
MSRV: 1.60.0 | |
jobs: | |
check: | |
name: Compile on MSRV | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.MSRV }} | |
- name: Set up Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo check | |
run: cargo +$MSRV check --all-targets | |
fmt: | |
name: Check formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Setup 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@v3 | |
with: | |
fetch-depth: 2 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.MSRV }} | |
components: clippy | |
- name: Set up Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Run clippy | |
run: cargo +$MSRV clippy --all-targets --all-features -- -D warnings | |
unit-tests: | |
name: Run unit tests | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, macOS-latest, ubuntu-latest] | |
rust: [stable, beta, 1.60.0] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Set up Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install cargo-nextest | |
uses: taiki-e/install-action@nextest | |
- name: Run unit tests | |
run: cargo +${{ matrix.rust }} nextest run --lib --all-features | |
integration-tests: | |
name: Run integration tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Setup 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: Run integration tests | |
run: cargo +$MSRV nextest run --all-features | |
msrv: | |
name: Validate MSRV | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.MSRV }} | |
- name: Prepare MSRV lockfile | |
run: cp ci/Cargo.lock.msrv Cargo.lock | |
- name: Set up Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install cargo-nextest | |
uses: taiki-e/install-action@nextest | |
- name: Run MSRV unit tests | |
run: cargo +$MSRV nextest run --lib --all-features | |
release: | |
name: Release | |
needs: [check, fmt, clippy, unit-tests, integration-tests, msrv] | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup 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 neo4j_testcontainers |