surrealpatch/.github/workflows/ci.yml
2023-04-11 20:23:45 +01:00

67 lines
1.6 KiB
YAML

name: Continuous integration
on:
push:
branches:
- main
pull_request:
branches:
- main
defaults:
run:
shell: bash
jobs:
test:
name: Test
runs-on: ubuntu-20.04
steps:
- 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 stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run cargo test
run: |
cargo build --locked --no-default-features --features storage-mem
(&>/dev/null ./target/debug/surreal start --log trace --user root --pass root memory &)
cargo test --locked --workspace --features protocol-ws,protocol-http,kv-rocksdb
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- 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 stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: rustfmt, clippy
- name: Run cargo check
run: cargo check --workspace
- name: Run cargo fmt
run: cargo fmt --all -- --check
- 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