Skip to content

Commit

Permalink
Optimise ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rushmorem committed Jan 10, 2023
1 parent db4ac26 commit aff0886
Show file tree
Hide file tree
Showing 16 changed files with 951 additions and 884 deletions.
138 changes: 121 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,148 @@ on:

jobs:

test:
name: Test
format:
name: Format
runs-on: ubuntu-20.04
steps:

- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Run cargo test
run: |
(&>/dev/null cargo run -- start --log trace --user root --pass root memory &)
cargo test --workspace --features protocol-ws,protocol-http,kv-rocksdb
- name: Checkout sources
uses: actions/checkout@v3

- name: Run cargo fmt
run: cargo fmt --all -- --check

lint:
name: Lint
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: Run cargo check
run: cargo check --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
components: rustfmt, clippy

- name: Checkout sources
uses: actions/checkout@v3

- name: Run cargo check
run: cargo check --workspace
run: cargo check --package surrealdb --features protocol-ws,protocol-http,kv-mem,kv-indxdb --target wasm32-unknown-unknown

- name: Run cargo fmt
run: cargo fmt --all -- --check
clippy:
name: 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: Run cargo clippy
run: cargo clippy -- -W warnings

- name: Run WebAssembly check
run: cargo check --features kv-mem,kv-indxdb,protocol-ws,protocol-http --target wasm32-unknown-unknown --package surrealdb
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: Run cargo test
run: cargo test --no-default-features --features storage-mem --workspace -- --skip start::test

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: Run cargo test
run: cargo test --no-default-features --features storage-mem start::test::any

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: Run cargo test
run: cargo test --no-default-features --features storage-mem start::test::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: Run cargo test
run: cargo test --no-default-features --features storage-mem start::test::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 --no-default-features --features storage-mem start::test::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 --no-default-features --features storage-rocksdb start::test::file
4 changes: 1 addition & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable

- name: Run cargo test
run: |
(&>/dev/null cargo run -- start --log trace --user root --pass root memory &)
cargo test --workspace --features protocol-ws,protocol-http,kv-rocksdb
run: cargo test --workspace --features protocol-ws,protocol-http,kv-rocksdb -- --skip start::test

lint:
name: Lint
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Nix

on:
- pull_request
- push
on: push

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable

- name: Run cargo test
run: cargo test --workspace
run: cargo test --workspace -- --skip start::test

lint:
name: Lint
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ thiserror = "1.0.37"
tokio = { version = "1.21.2", features = ["macros", "signal"] }
warp = { version = "0.3.3", features = ["compression", "tls", "websocket"] }

[dev-dependencies]
time = { version = "0.3.17", features = ["serde"] }
ulid = { version = "1.0.0", features = ["serde"] }

[package.metadata.deb]
maintainer-scripts = "pkg/deb/"
maintainer = "Tobie Morgan Hitchcock <tobie@surrealdb.com>"
Expand Down
9 changes: 4 additions & 5 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ features = [
"properties",
]

[dev-dependencies]
time = { version = "0.3.17", features = ["serde"] }
tokio = { version = "1.22.0", features = ["macros", "rt", "rt-multi-thread"] }
ulid = { version = "1.0.0", features = ["serde"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
pharos = "0.5.3"
tokio = { version = "1.22.0", default-features = false, features = ["rt"] }
Expand All @@ -129,3 +124,7 @@ ws_stream_wasm = "0.7.3"
tokio = { version = "1.22.0", default-features = false, features = ["io-util", "fs", "rt-multi-thread"] }
tokio-tungstenite = { version = "0.17.2", optional = true }
uuid = { version = "1.2.1", features = ["serde", "v4", "v7"] }

[dev-dependencies]
time = { version = "0.3.17", features = ["serde"] }
tokio = { version = "1.22.0", features = ["macros", "rt-multi-thread"] }

0 comments on commit aff0886

Please sign in to comment.