diff --git a/.github/workflows/test-rust.yml b/.github/workflows/test-rust.yml new file mode 100644 index 0000000..8f4de26 --- /dev/null +++ b/.github/workflows/test-rust.yml @@ -0,0 +1,24 @@ +name: rust-unit-tests +run-name: $${ github.actor }} - Unit Tests +on: [push] +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - name: Create Sqlite database + uses: actions-rs/cargo@v1 + with: + command: install + args: sqlx-cli + - run: make db + - uses: actions-rs/cargo@v1 + with: + command: test + args: --workspace --all-features + diff --git a/Cargo.toml b/Cargo.toml index 6949970..57303e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,5 @@ members = [ ] [dependencies] -lsps-client = { path = "plugins/lsps-client/" } -lsps-server = { path = "plugins/lsps-server/" } lsp-primitives = {path = "libs/lsp-primitives"} cln-lsps = {path = "libs/cln-lsps" } diff --git a/Makefile b/Makefile index 044d2fe..2bdd9a8 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ all: lsps-server lsps-client base: mkdir -p build/plugins +# Initiates a database that is used for testing +db: plugins/lsps-server/data/lsp_server.db + plugins/lsps-server/data/lsp_server.db: mkdir -p plugins/lsps-server/data sqlx database create --database-url sqlite:plugins/lsps-server/data/lsp_server.db