2022-03-05 14:50:18 +00:00
|
|
|
name: Continuous integration
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
2023-03-30 20:14:06 +00:00
|
|
|
# Setting the shell option, it will run 'bash --noprofile --norc -eo pipefail {0}'
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2022-03-05 14:50:18 +00:00
|
|
|
jobs:
|
|
|
|
|
|
|
|
test:
|
|
|
|
name: Test
|
2023-03-29 18:16:18 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-03-05 14:50:18 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
2022-12-26 14:14:05 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-07-13 09:28:08 +00:00
|
|
|
|
2023-03-29 18:16:18 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install protobuf-compiler
|
|
|
|
|
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: |
|
2023-03-30 10:41:44 +00:00
|
|
|
(&>/dev/null cargo run --no-default-features -F storage-mem -- start --log trace --user root --pass root memory &)
|
2022-12-30 08:23:19 +00:00
|
|
|
cargo test --workspace --features protocol-ws,protocol-http,kv-rocksdb
|
2022-03-05 14:50:18 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
name: Lint
|
2023-03-29 18:16:18 +00:00
|
|
|
runs-on: ubuntu-latest
|
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
|
|
|
|
2023-03-29 18:16:18 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install protobuf-compiler
|
|
|
|
|
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
|
|
|
|
2023-01-01 12:24:00 +00:00
|
|
|
- name: Run cargo check
|
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
|
|
|
|
2023-01-01 12:24:00 +00:00
|
|
|
- name: Run WebAssembly check
|
2023-01-02 09:10:04 +00:00
|
|
|
run: cargo check --features kv-mem,kv-indxdb,protocol-ws,protocol-http --target wasm32-unknown-unknown --package surrealdb
|