Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
pull_request:
paths:
- '**/*.scala'
- '**/*.sbt'
- '.scalafmt.conf'
- 'project/**'
- '.github/workflows/ci.yaml'

env:
SBT_OPTS: "-Xmx2G -XX:+UseG1GC -Xss2M"
GITHUB_TOKEN: ${{ secrets.READ_PACKAGES }}

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: sbt/setup-sbt@v1
with:
sbt-runner-version: 1.9.9
- run: sbt scalafmtCheckAll
- run: sbt headerCheckAll

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: sbt/setup-sbt@v1
with:
sbt-runner-version: 1.9.9
- name: Run tests
run: sbt clean test

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: target/test-results
25 changes: 25 additions & 0 deletions .github/workflows/docker-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Docker CI

on:
pull_request:
paths:
- .github/workflows/docker-ci.yaml
- build.sbt

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: sbt/setup-sbt@v1
with:
sbt-runner-version: 1.9.9
- name: Build Docker image
env:
GITHUB_TOKEN: ${{ secrets.READ_PACKAGES }}
run: sbt docker/Docker/publishLocal
60 changes: 60 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: publish
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
- "v*.*.*-*"

env:
GITHUB_TOKEN: ${{ secrets.WRITE_PACKAGES }}

jobs:
publish-jars:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: sbt/setup-sbt@v1
with:
sbt-runner-version: 1.9.9
- name: publish
run: sbt clean publish
publish-docker-image:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: sbt/setup-sbt@v1
with:
sbt-runner-version: 1.9.9
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.WRITE_PACKAGES }}
logout: false
- name: publish docker images
run: sbt docker/Docker/publish
gh-release:
needs: [publish-jars, publish-docker-image]
runs-on: self-hosted
steps:
- uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.RAW_CI_PAT }}
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
tag_name: ${{ github.ref_name }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.class
.metals/
.git/
.vscode/
target/
.bsp/
.idea/
7 changes: 7 additions & 0 deletions .sbtopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-J-Xmx4G
-J-Xms1G
-J-Xss4M
-J-XX:+UseG1GC
-J--add-opens=java.base/java.lang=ALL-UNNAMED
-J--add-opens=java.base/java.util=ALL-UNNAMED
-J-XX:+CrashOnOutOfMemoryError
17 changes: 17 additions & 0 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
updates.allow = [
{
groupId = "com.raw-labs"
}
]

pullRequests = {
frequency = "@asap"
customLabels = ["dependencies", "com.raw-labs"]
includeMatchedLabels = "(.*semver.*)"
}

pullRequests.grouping = [
{ name = "patches", "title" = "Patch updates", "filter" = [{"version" = "patch"}] }
]

assignees = ["datYori"]
32 changes: 32 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version = "3.8.3"
runner.dialect = "scala213"
style = "IntelliJ"
maxColumn = 120
indentOperator.include = "^.*=$"
rewrite.rules = [Imports, RedundantParens, SortModifiers]
rewrite.imports.sort = ascii
rewrite.imports.groups = [
["java.?\\..*"],
["sbt\\..*"],
["scala\\..*"],
["org\\..*"],
["com\\..*"],
]
newlines.alwaysBeforeElseAfterCurlyIf = false
danglingParentheses {
callSite = false
defnSite = false
}
align {
preset = some
openParenDefnSite = false
openParenCallSite = false
}
docstrings.style = Asterisk
docstrings.wrap = fold
optIn.configStyleArguments = false
spaces {
inImportCurlyBraces = false
}
continuationIndent.defnSite = 4
runner.optimizer.maxVisitsPerToken = 15000
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Source code in this repository is variously licensed under the Business Source License 1.1 (BSL) and the Apache 2.0 license.
A copy of each license can be found in the licenses directory.
Source code in a given file is licensed under the BSL and the copyright belongs to RAW Labs S.A. unless otherwise noted at the beginning of the file.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# das-sqlite
# DAS SQLite
[![License](https://img.shields.io/:license-BSL%201.1-blue.svg)](/licenses/BSL.txt)

[Data Access Service](https://github.com/raw-labs/protocol-das) for SQLite.

## Options

| Name | Description | Default | Required |
|------------|---------------------------------------|----------|----------|
| `database` | The path to the SQLite database | | Yes |

## How to use

First you need to build the project:
```bash
$ sbt "project docker" "docker:publishLocal"
```

This will create a docker image with the name `das-excel`.

Then you can run the image with the following command:
```bash
$ docker run -p 50051:50051 <image_id>
```
... where `<image_id>` is the id of the image created in the previous step.
This will start the server, typically on port 50051.

You can find the image id by looking at the sbt output or by running:
```bash
$ docker images
```
Loading
Loading