Merge pull request #19 from robsdedude/fix/path #140
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: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
lints: | |
name: Linting | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install nightly toolchain for cargo-check-external-types | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: nightly-2024-06-30 | |
- name: install latest nightly toolchain for rustfmt | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- name: install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: versions | |
run: | | |
set -x | |
rustup show | |
cargo --version | |
cargo +nightly --version | |
cargo clippy --version | |
- name: cargo fmt | |
run: cargo +nightly fmt --all -- --check | |
- name: clippy all | |
run: cargo clippy --all --all-features -- -D warnings | |
- name: clippy driver | |
run: cargo clippy -p neo4j -- -D warnings | |
- name: check exported dependencies | |
run: | | |
set -x | |
pushd neo4j | |
cargo install --locked [email protected] | |
cargo +nightly-2024-06-30 check-external-types | |
popd | |
- name: API stability check | |
run: cargo test --workspace --features _internal_public_api public_api | |
tests: | |
name: Testing | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
rust-version: [ "1.70", "stable" ] | |
steps: | |
- name: pull neo4j docker image | |
run: docker pull neo4j:5.6-enterprise | |
- name: make neo4j logs directory | |
run: mkdir -p neo4j/logs | |
- name: start neo4j | |
id: start_neo4j | |
run: docker run | |
-d --name neo4j | |
-v ${{ github.workspace }}/neo4j/logs:/logs | |
-p 7474:7474 -p 7687:7687 | |
-e NEO4J_AUTH=neo4j/pass | |
-e NEO4J_ACCEPT_LICENSE_AGREEMENT=yes | |
-e NEO4J_dbms_security_auth__minimum__password__length=1 | |
neo4j:5.6-enterprise & | |
- uses: actions/checkout@v4 | |
with: | |
path: driver | |
- name: put Cargo.lock in place | |
working-directory: driver | |
run: cp .github/Cargo.lock Cargo.lock | |
- name: install ${{ matrix.rust-version }} toolchain to test against | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust-version }} | |
components: clippy | |
- name: versions | |
run: | | |
rustup show | |
cargo --version | |
cargo clippy --version | |
- name: cargo check | |
working-directory: driver | |
env: | |
RUSTFLAGS: -D warnings | |
run: cargo check | |
- name: docs build | |
working-directory: driver | |
run: RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps | |
- name: tests | |
working-directory: driver | |
env: | |
TEST_NEO4J_SCHEME: neo4j | |
TEST_NEO4J_HOST: localhost | |
TEST_NEO4J_PORT: 7687 | |
TEST_NEO4J_USER: neo4j | |
TEST_NEO4J_PASS: pass | |
TEST_NEO4J_EDITION: enterprise | |
TEST_NEO4J_VERSION: 5.6 | |
run: cargo test --workspace --all-targets | |
- name: doc tests | |
working-directory: driver | |
env: | |
TEST_NEO4J_SCHEME: neo4j | |
TEST_NEO4J_HOST: localhost | |
TEST_NEO4J_PORT: 7687 | |
TEST_NEO4J_USER: neo4j | |
TEST_NEO4J_PASS: pass | |
TEST_NEO4J_EDITION: enterprise | |
TEST_NEO4J_VERSION: 5.6 | |
run: cargo test --workspace --doc | |
- name: stop neo4j | |
if: ${{ !cancelled() && steps.start_neo4j.conclusion == 'success' }} | |
run: | | |
docker stop neo4j | |
docker logs neo4j > neo4j/neo4j_docker.log 2>&1 | |
docker rm neo4j | |
- name: upload artifacts (neo4j logs) | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests-${{ matrix.rust-version }}-neo4j-logs | |
path: neo4j | |
testkit: | |
name: TestKit | |
needs: [ tests, lints ] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
tests: [ TESTKIT_TESTS ] | |
config: | |
- 4.4-community-bolt | |
- 4.4-community-neo4j | |
- 4.4-enterprise-bolt | |
- 4.4-enterprise-neo4j | |
- 4.4-enterprise-cluster-neo4j | |
- 5.1-enterprise-cluster-neo4j | |
- 5.5-enterprise-cluster-neo4j | |
- 5.7-enterprise-cluster-neo4j | |
- 5.9-enterprise-cluster-neo4j | |
include: | |
- tests: STUB_TESTS | |
config: "" | |
- tests: TLS_TESTS | |
config: "" | |
steps: | |
- name: Checkout driver | |
uses: actions/checkout@v4 | |
with: | |
path: driver | |
- name: put Cargo.lock in place | |
working-directory: driver | |
run: cp .github/Cargo.lock Cargo.lock | |
# - name: Read required TestKit version from driver repo | |
# id: testkit_vars | |
# run: echo ::set-output name=testkit_version_ref::$(cat driver/.testkit_version | xargs) | |
- name: Checkout TestKit | |
uses: actions/checkout@v4 | |
with: | |
repository: robsdedude/testkit | |
path: testkit | |
ref: rust | |
# ref: ${{ steps.testkit_vars.outputs.testkit_version_ref }} | |
- name: Run TestKit | |
env: | |
TEST_DRIVER_NAME: rust | |
TEST_DRIVER_REPO: ${{ github.workspace }}/driver | |
TEST_RUN_ALL_TESTS: "true" | |
run: | | |
cd testkit | |
python3 main.py --tests ${{ matrix.tests }} \ | |
${{ matrix.config && format('--config {0}', matrix.config) || ''}} | |
- name: upload artifacts (TestKit logs) | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: testkit-${{ matrix.tests }}${{ matrix.config && format('-{0}', matrix.config) || ''}}-artifacts | |
path: testkit/artifacts | |
compression-level: 9 | |
ci-end: | |
name: CI End | |
needs: [ tests, lints, testkit ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: All Done! | |
run: echo This is a single job to check all the other jobs have passed. |