name: Continuous integration on: push: pull_request: merge_group: defaults: run: shell: bash jobs: format: name: Check format runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable with: components: rustfmt - name: Checkout sources uses: actions/checkout@v3 - name: Run cargo fmt run: cargo fmt --all -- --check check: name: Check workspace runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Install dependencies run: | sudo apt-get -y update sudo apt-get -y install protobuf-compiler libprotobuf-dev - name: Run cargo check run: cargo check --locked --workspace check-wasm: name: Check Wasm runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable with: targets: wasm32-unknown-unknown - name: Checkout sources uses: actions/checkout@v3 - name: Run cargo check run: cargo check --locked --package surrealdb --features protocol-ws,protocol-http,kv-mem,kv-indxdb,http --target wasm32-unknown-unknown clippy: name: Check clippy runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable with: components: clippy - name: Checkout sources uses: actions/checkout@v3 - name: Install dependencies run: | sudo apt-get -y update sudo apt-get -y install protobuf-compiler libprotobuf-dev - name: Run cargo clippy run: cargo clippy --no-deps -- -W warnings cli: name: Test command line runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Install dependencies run: | sudo apt-get -y update sudo apt-get -y install protobuf-compiler libprotobuf-dev - name: Run cargo test run: cargo test --locked --no-default-features --features storage-mem --workspace --test cli test: name: Test workspace runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Install dependencies run: | sudo apt-get -y update sudo apt-get -y install protobuf-compiler libprotobuf-dev - name: Run cargo test run: cargo test --locked --no-default-features --features storage-mem,scripting,http --workspace -- --skip api_integration --skip cli ws-engine: name: WebSocket engine runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Install dependencies run: | sudo apt-get -y update sudo apt-get -y install protobuf-compiler libprotobuf-dev - name: Setup FoundationDB uses: foundationdb-rs/foundationdb-actions-install@v2.0.0 with: version: "7.1.30" - name: Run cargo test run: | cargo build --locked --no-default-features --features storage-fdb (&>/dev/null ./target/debug/surreal start --log trace --user root --pass root fdb:/etc/foundationdb/fdb.cluster &) cargo test --locked --package surrealdb --no-default-features --features protocol-ws --test api api_integration::ws http-engine: name: HTTP engine runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Install dependencies run: | sudo apt-get -y update sudo apt-get -y install protobuf-compiler libprotobuf-dev - name: Setup FoundationDB uses: foundationdb-rs/foundationdb-actions-install@v2.0.0 with: version: "7.1.30" - name: Run cargo test run: | cargo build --locked --no-default-features --features storage-fdb (&>/dev/null ./target/debug/surreal start --log trace --user root --pass root fdb:/etc/foundationdb/fdb.cluster &) cargo test --locked --package surrealdb --no-default-features --features protocol-http --test api api_integration::http mem-engine: name: Memory engine runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Run cargo test run: | cargo test --locked --package surrealdb --no-default-features --features kv-mem --lib kvs cargo test --locked --package surrealdb --no-default-features --features kv-mem --test api api_integration::mem file-engine: name: File engine runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Run cargo test run: | cargo test --locked --package surrealdb --no-default-features --features kv-rocksdb --lib kvs cargo test --locked --package surrealdb --no-default-features --features kv-rocksdb --test api api_integration::file rocksdb-engine: name: RocksDB engine runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Run cargo test run: | cargo test --locked --package surrealdb --no-default-features --features kv-rocksdb --lib kvs cargo test --locked --package surrealdb --no-default-features --features kv-rocksdb --test api api_integration::rocksdb speedb-engine: name: SpeeDB engine runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Run cargo test run: | cargo test --locked --package surrealdb --no-default-features --features kv-speedb --lib kvs cargo test --locked --package surrealdb --no-default-features --features kv-speedb --test api api_integration::speedb tikv-engine: name: TiKV engine runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Install dependencies run: | sudo apt-get -y update sudo apt-get -y install protobuf-compiler libprotobuf-dev - name: Install TiKV run: | curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh ~/.tiup/bin/tiup install tikv pd ~/.tiup/bin/tiup -v - name: Run cargo test run: | (&>/dev/null ~/.tiup/bin/tiup playground --mode tikv-slim --kv 3 --without-monitor &) cargo test --locked --package surrealdb --no-default-features --features kv-tikv --lib kvs cargo test --locked --package surrealdb --no-default-features --features kv-tikv --test api api_integration::tikv fdb-engine: name: FoundationDB engine runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Setup FoundationDB uses: foundationdb-rs/foundationdb-actions-install@v2.0.0 with: version: "7.1.30" - name: Run cargo test run: | cargo test --locked --package surrealdb --no-default-features --features kv-fdb-7_1 --lib kvs cargo test --locked --package surrealdb --no-default-features --features kv-fdb-7_1 --test api api_integration::fdb any-engine: name: Any engine runs-on: ubuntu-20.04 steps: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Checkout sources uses: actions/checkout@v3 - name: Install dependencies run: | sudo apt-get -y update sudo apt-get -y install protobuf-compiler libprotobuf-dev - name: Setup FoundationDB uses: foundationdb-rs/foundationdb-actions-install@v2.0.0 with: version: "7.1.30" - name: Run cargo test run: | cargo build --locked --no-default-features --features storage-fdb (&>/dev/null ./target/debug/surreal start --log trace --user root --pass root fdb:/etc/foundationdb/fdb.cluster &) cargo test --locked --package surrealdb --no-default-features --features protocol-http --test api api_integration::any