surrealpatch/.github/workflows/ci.yml

76 lines
1.8 KiB
YAML
Raw Normal View History

name: Continuous integration
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: Test
runs-on: ubuntu-20.04
steps:
2022-07-13 09:28:08 +00:00
- name: Checkout sources
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/
key: ubuntu-20.04-test-cargo-${{ hashFiles('**/Cargo.lock') }}
2022-07-13 09:28:08 +00:00
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
2022-07-13 09:28:08 +00:00
- 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
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
2022-07-13 09:28:08 +00:00
- name: Checkout sources
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/
key: ubuntu-20.04-lint-cargo-${{ hashFiles('**/Cargo.lock') }}
2022-07-13 09:28:08 +00:00
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: rustfmt, clippy
2022-07-13 09:28:08 +00:00
- name: Run cargo check
run: cargo check --workspace
2022-07-13 09:28:08 +00:00
- name: Run cargo fmt
run: cargo fmt --all -- --check
2022-07-13 09:28:08 +00:00
- 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