2022-03-05 14:50:18 +00:00
|
|
|
name: Continuous integration
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
2023-05-30 18:44:47 +00:00
|
|
|
merge_group:
|
2022-03-05 14:50:18 +00:00
|
|
|
|
2023-03-30 20:14:06 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2022-03-05 14:50:18 +00:00
|
|
|
jobs:
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
format:
|
|
|
|
name: Check format
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-03-05 14:50:18 +00:00
|
|
|
steps:
|
2023-04-17 13:27:32 +00:00
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
components: rustfmt
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-06-19 22:35:19 +00:00
|
|
|
- name: Check format of code
|
|
|
|
run: cargo fmt --all --check
|
|
|
|
|
|
|
|
- name: Check format of unlinked tests
|
|
|
|
run: cargo fmt --all --check -- ./lib/tests/**/*.rs ./lib/src/kvs/tests/*.rs
|
2023-04-17 13:27:32 +00:00
|
|
|
|
|
|
|
check:
|
|
|
|
name: Check workspace
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-17 13:27:32 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
2022-03-05 14:50:18 +00:00
|
|
|
- name: Checkout sources
|
2022-12-26 14:14:05 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-03-31 19:12:10 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install protobuf-compiler libprotobuf-dev
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Run cargo check
|
|
|
|
run: cargo check --locked --workspace
|
|
|
|
|
|
|
|
check-wasm:
|
|
|
|
name: Check Wasm
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-17 13:27:32 +00:00
|
|
|
steps:
|
|
|
|
|
2022-03-05 14:50:18 +00:00
|
|
|
- name: Install stable toolchain
|
2022-12-26 14:14:05 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2023-04-17 13:27:32 +00:00
|
|
|
with:
|
|
|
|
targets: wasm32-unknown-unknown
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Run cargo check
|
2023-05-05 18:14:36 +00:00
|
|
|
run: cargo check --locked --package surrealdb --features protocol-ws,protocol-http,kv-mem,kv-indxdb,http --target wasm32-unknown-unknown
|
2023-04-17 13:27:32 +00:00
|
|
|
|
|
|
|
clippy:
|
|
|
|
name: Check clippy
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-17 13:27:32 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
components: clippy
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install protobuf-compiler libprotobuf-dev
|
|
|
|
|
|
|
|
- name: Run cargo clippy
|
2023-06-20 11:48:20 +00:00
|
|
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
2023-04-17 13:27:32 +00:00
|
|
|
|
2023-06-10 20:30:37 +00:00
|
|
|
cli:
|
|
|
|
name: Test command line
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-06-10 20:30:37 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-06-10 20:30:37 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install protobuf-compiler libprotobuf-dev
|
|
|
|
|
|
|
|
- name: Run cargo test
|
2023-07-19 14:35:56 +00:00
|
|
|
run: cargo test --locked --no-default-features --features storage-mem --workspace --test cli_integration
|
|
|
|
|
|
|
|
http-server:
|
|
|
|
name: Test HTTP server
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-07-19 14:35:56 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
|
|
|
- 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 http_integration
|
2023-06-10 20:30:37 +00:00
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
test:
|
|
|
|
name: Test workspace
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-17 13:27:32 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install protobuf-compiler libprotobuf-dev
|
|
|
|
|
2023-06-23 19:21:02 +00:00
|
|
|
- name: Install cargo-llvm-cov
|
|
|
|
uses: taiki-e/install-action@cargo-llvm-cov
|
|
|
|
|
|
|
|
- name: Run cargo test (+coverage)
|
2023-07-29 18:47:25 +00:00
|
|
|
run: |
|
|
|
|
(set -x; df -h)
|
|
|
|
# Free up some disk space by removing unused files
|
|
|
|
(set -x; sudo rm -rf /imagegeneration || true)
|
|
|
|
(set -x; sudo rm -rf /opt/az || true)
|
|
|
|
(set -x; sudo rm -rf /opt/hostedtoolcache || true)
|
|
|
|
(set -x; sudo rm -rf /opt/google || true)
|
|
|
|
(set -x; sudo rm -rf /opt/pipx || true)
|
|
|
|
(set -x; df -h)
|
|
|
|
|
|
|
|
cargo llvm-cov --html --locked --no-default-features --features storage-mem,scripting,http --workspace -- --skip api_integration --skip cli_integration --skip http_integration
|
|
|
|
(set -x; df -h)
|
2023-06-23 19:21:02 +00:00
|
|
|
|
|
|
|
- name: Upload coverage report
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: code-coverage-report
|
|
|
|
path: target/llvm-cov/html/
|
|
|
|
retention-days: 5
|
2023-04-17 13:27:32 +00:00
|
|
|
|
|
|
|
ws-engine:
|
|
|
|
name: WebSocket engine
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-17 13:27:32 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install protobuf-compiler libprotobuf-dev
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2023-06-13 20:55:38 +00:00
|
|
|
- name: Setup FoundationDB
|
|
|
|
uses: foundationdb-rs/foundationdb-actions-install@v2.0.0
|
|
|
|
with:
|
|
|
|
version: "7.1.30"
|
|
|
|
|
2022-03-05 14:50:18 +00:00
|
|
|
- name: Run cargo test
|
2022-12-30 08:23:19 +00:00
|
|
|
run: |
|
2023-06-13 20:55:38 +00:00
|
|
|
cargo build --locked --no-default-features --features storage-fdb
|
2023-07-29 18:47:25 +00:00
|
|
|
(&>/dev/null ./target/debug/surreal start --auth --log trace --user root --pass root fdb:/etc/foundationdb/fdb.cluster &)
|
2023-04-17 13:27:32 +00:00
|
|
|
cargo test --locked --package surrealdb --no-default-features --features protocol-ws --test api api_integration::ws
|
2022-03-05 14:50:18 +00:00
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
http-engine:
|
|
|
|
name: HTTP engine
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-03-05 14:50:18 +00:00
|
|
|
steps:
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
2022-03-05 14:50:18 +00:00
|
|
|
- name: Checkout sources
|
2022-12-26 14:14:05 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-03-31 19:12:10 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install protobuf-compiler libprotobuf-dev
|
|
|
|
|
2023-06-13 20:55:38 +00:00
|
|
|
- name: Setup FoundationDB
|
|
|
|
uses: foundationdb-rs/foundationdb-actions-install@v2.0.0
|
|
|
|
with:
|
|
|
|
version: "7.1.30"
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Run cargo test
|
|
|
|
run: |
|
2023-06-13 20:55:38 +00:00
|
|
|
cargo build --locked --no-default-features --features storage-fdb
|
2023-07-29 18:47:25 +00:00
|
|
|
(&>/dev/null ./target/debug/surreal start --auth --log trace --user root --pass root fdb:/etc/foundationdb/fdb.cluster &)
|
2023-04-17 13:27:32 +00:00
|
|
|
cargo test --locked --package surrealdb --no-default-features --features protocol-http --test api api_integration::http
|
|
|
|
|
|
|
|
mem-engine:
|
|
|
|
name: Memory engine
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-17 13:27:32 +00:00
|
|
|
steps:
|
|
|
|
|
2022-03-05 14:50:18 +00:00
|
|
|
- name: Install stable toolchain
|
2022-12-26 14:14:05 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Run cargo test
|
2023-06-10 20:30:37 +00:00
|
|
|
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
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
file-engine:
|
|
|
|
name: File engine
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-17 13:27:32 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Run cargo test
|
2023-06-10 20:30:37 +00:00
|
|
|
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
|
2023-04-17 13:27:32 +00:00
|
|
|
|
2023-05-31 12:35:41 +00:00
|
|
|
rocksdb-engine:
|
|
|
|
name: RocksDB engine
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-05-31 12:35:41 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-05-31 12:35:41 +00:00
|
|
|
- name: Run cargo test
|
2023-06-10 20:30:37 +00:00
|
|
|
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
|
2023-05-31 12:35:41 +00:00
|
|
|
|
|
|
|
speedb-engine:
|
|
|
|
name: SpeeDB engine
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-05-31 12:35:41 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-05-31 12:35:41 +00:00
|
|
|
- name: Run cargo test
|
2023-06-10 20:30:37 +00:00
|
|
|
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
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-06-10 20:30:37 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-06-10 20:30:37 +00:00
|
|
|
- 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
|
2023-05-31 12:35:41 +00:00
|
|
|
|
2023-06-13 20:55:38 +00:00
|
|
|
fdb-engine:
|
|
|
|
name: FoundationDB engine
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-06-13 20:55:38 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-06-13 20:55:38 +00:00
|
|
|
- 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
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
any-engine:
|
|
|
|
name: Any engine
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-17 13:27:32 +00:00
|
|
|
steps:
|
2022-12-30 08:23:19 +00:00
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-06-23 11:58:15 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install protobuf-compiler libprotobuf-dev
|
|
|
|
|
2023-06-13 20:55:38 +00:00
|
|
|
- name: Setup FoundationDB
|
|
|
|
uses: foundationdb-rs/foundationdb-actions-install@v2.0.0
|
|
|
|
with:
|
|
|
|
version: "7.1.30"
|
|
|
|
|
2023-04-17 13:27:32 +00:00
|
|
|
- name: Run cargo test
|
|
|
|
run: |
|
2023-06-13 20:55:38 +00:00
|
|
|
cargo build --locked --no-default-features --features storage-fdb
|
2023-07-29 18:47:25 +00:00
|
|
|
(&>/dev/null ./target/debug/surreal start --auth --log trace --user root --pass root fdb:/etc/foundationdb/fdb.cluster &)
|
2023-04-17 13:27:32 +00:00
|
|
|
cargo test --locked --package surrealdb --no-default-features --features protocol-http --test api api_integration::any
|