2022-03-05 14:50:18 +00:00
|
|
|
name: Continuous integration
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
test:
|
|
|
|
name: Test
|
2022-12-21 11:42:43 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2022-03-05 14:50:18 +00:00
|
|
|
steps:
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2022-12-30 08:23:19 +00:00
|
|
|
- name: Free disk space
|
|
|
|
uses: jlumbroso/free-disk-space@main
|
|
|
|
with:
|
|
|
|
large-packages: false
|
|
|
|
swap-storage: false
|
|
|
|
|
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
|
|
|
|
|
|
|
- name: Cache cargo assets
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
2022-12-21 11:42:43 +00:00
|
|
|
key: ubuntu-20.04-test-cargo-${{ hashFiles('**/Cargo.lock') }}
|
2022-07-13 09:28:08 +00:00
|
|
|
|
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
|
|
|
|
2022-03-05 14:50:18 +00:00
|
|
|
- name: Run cargo test
|
2022-12-30 08:23:19 +00:00
|
|
|
run: |
|
|
|
|
(&>/dev/null cargo run -- start --log trace --user root --pass root memory &)
|
|
|
|
cargo test --workspace --features protocol-ws,protocol-http,kv-rocksdb
|
2022-03-05 14:50:18 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
name: Lint
|
2022-12-21 11:42:43 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2022-03-05 14:50:18 +00:00
|
|
|
steps:
|
2022-07-13 09:28:08 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
- name: Cache cargo assets
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
2022-12-21 11:42:43 +00:00
|
|
|
key: ubuntu-20.04-lint-cargo-${{ hashFiles('**/Cargo.lock') }}
|
2022-07-13 09:28:08 +00:00
|
|
|
|
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-03-05 14:50:18 +00:00
|
|
|
with:
|
2022-12-30 08:23:19 +00:00
|
|
|
targets: wasm32-unknown-unknown
|
2022-03-05 14:50:18 +00:00
|
|
|
components: rustfmt, clippy
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2022-12-08 16:31:47 +00:00
|
|
|
- name: Run cargo check --package surrealdb
|
2022-12-26 14:14:05 +00:00
|
|
|
run: cargo check --no-default-features --package surrealdb
|
2022-12-08 16:31:47 +00:00
|
|
|
|
|
|
|
- name: Run cargo check --workspace
|
2022-12-26 14:14:05 +00:00
|
|
|
run: cargo check --workspace
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2022-03-05 14:50:18 +00:00
|
|
|
- name: Run cargo fmt
|
2022-12-26 14:14:05 +00:00
|
|
|
run: cargo fmt --all -- --check
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2022-03-05 14:50:18 +00:00
|
|
|
- name: Run cargo clippy
|
2022-12-26 14:14:05 +00:00
|
|
|
run: cargo clippy -- -W warnings
|
2022-12-30 08:23:19 +00:00
|
|
|
|
|
|
|
- name: Run native cargo check --package surrealdb
|
|
|
|
run: cargo check --no-default-features --package surrealdb
|
|
|
|
|
|
|
|
- name: Run Wasm cargo check --package surrealdb
|
|
|
|
run: cargo check --features protocol-ws,protocol-http,kv-mem --target wasm32-unknown-unknown --package surrealdb
|
|
|
|
|
|
|
|
- name: Check IndxDB
|
|
|
|
run: cargo check --no-default-features --features kv-indxdb --target wasm32-unknown-unknown --package surrealdb
|
|
|
|
|
|
|
|
- name: Run cargo check --workspace
|
|
|
|
run: cargo check --workspace
|