Skip to content

Commit 342c7a6

Browse files
First working implementation
1 parent 97222eb commit 342c7a6

22 files changed

+3118
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.scala'
7+
- '**/*.sbt'
8+
- '.scalafmt.conf'
9+
- 'project/**'
10+
- '.github/workflows/ci.yaml'
11+
12+
env:
13+
SBT_OPTS: "-Xmx2G -XX:+UseG1GC -Xss2M"
14+
GITHUB_TOKEN: ${{ secrets.READ_PACKAGES }}
15+
16+
jobs:
17+
lint:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-java@v4
23+
with:
24+
distribution: 'temurin'
25+
java-version: '21'
26+
- uses: sbt/setup-sbt@v1
27+
with:
28+
sbt-runner-version: 1.9.9
29+
- run: sbt scalafmtCheckAll
30+
- run: sbt headerCheckAll
31+
32+
test:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: actions/setup-java@v4
37+
with:
38+
distribution: 'temurin'
39+
java-version: '21'
40+
- uses: sbt/setup-sbt@v1
41+
with:
42+
sbt-runner-version: 1.9.9
43+
- name: Run tests
44+
run: sbt clean test
45+
46+
- name: Upload test results
47+
if: always()
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: test-results
51+
path: target/test-results

.github/workflows/docker-ci.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Docker CI
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/docker-ci.yaml
7+
- build.sbt
8+
9+
jobs:
10+
docker-build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: docker/setup-buildx-action@v3
15+
- uses: actions/setup-java@v4
16+
with:
17+
distribution: 'temurin'
18+
java-version: '21'
19+
- uses: sbt/setup-sbt@v1
20+
with:
21+
sbt-runner-version: 1.9.9
22+
- name: Build Docker image
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.READ_PACKAGES }}
25+
run: sbt docker/Docker/publishLocal

.github/workflows/publish.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: publish
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
- "v*.*.*-*"
8+
9+
env:
10+
GITHUB_TOKEN: ${{ secrets.WRITE_PACKAGES }}
11+
12+
jobs:
13+
publish-jars:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/setup-java@v4
20+
with:
21+
distribution: 'temurin'
22+
java-version: '21'
23+
- uses: sbt/setup-sbt@v1
24+
with:
25+
sbt-runner-version: 1.9.9
26+
- name: publish
27+
run: sbt clean publish
28+
publish-docker-image:
29+
runs-on: self-hosted
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
- uses: actions/setup-java@v4
35+
with:
36+
distribution: 'temurin'
37+
java-version: '21'
38+
- uses: sbt/setup-sbt@v1
39+
with:
40+
sbt-runner-version: 1.9.9
41+
- uses: docker/setup-buildx-action@v3
42+
- uses: docker/login-action@v3
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.WRITE_PACKAGES }}
47+
logout: false
48+
- name: publish docker images
49+
run: sbt docker/Docker/publish
50+
gh-release:
51+
needs: [publish-jars, publish-docker-image]
52+
runs-on: self-hosted
53+
steps:
54+
- uses: softprops/action-gh-release@v2
55+
with:
56+
token: ${{ secrets.RAW_CI_PAT }}
57+
generate_release_notes: true
58+
draft: false
59+
prerelease: ${{ contains(github.ref_name, '-') }}
60+
tag_name: ${{ github.ref_name }}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.class
2+
.metals/
3+
.git/
4+
.vscode/
5+
target/
6+
.bsp/
7+
.idea/

.sbtopts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-J-Xmx4G
2+
-J-Xms1G
3+
-J-Xss4M
4+
-J-XX:+UseG1GC
5+
-J--add-opens=java.base/java.lang=ALL-UNNAMED
6+
-J--add-opens=java.base/java.util=ALL-UNNAMED
7+
-J-XX:+CrashOnOutOfMemoryError

.scala-steward.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
updates.allow = [
2+
{
3+
groupId = "com.raw-labs"
4+
}
5+
]
6+
7+
pullRequests = {
8+
frequency = "@asap"
9+
customLabels = ["dependencies", "com.raw-labs"]
10+
includeMatchedLabels = "(.*semver.*)"
11+
}
12+
13+
pullRequests.grouping = [
14+
{ name = "patches", "title" = "Patch updates", "filter" = [{"version" = "patch"}] }
15+
]
16+
17+
assignees = ["datYori"]

.scalafmt.conf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version = "3.8.3"
2+
runner.dialect = "scala213"
3+
style = "IntelliJ"
4+
maxColumn = 120
5+
indentOperator.include = "^.*=$"
6+
rewrite.rules = [Imports, RedundantParens, SortModifiers]
7+
rewrite.imports.sort = ascii
8+
rewrite.imports.groups = [
9+
["java.?\\..*"],
10+
["sbt\\..*"],
11+
["scala\\..*"],
12+
["org\\..*"],
13+
["com\\..*"],
14+
]
15+
newlines.alwaysBeforeElseAfterCurlyIf = false
16+
danglingParentheses {
17+
callSite = false
18+
defnSite = false
19+
}
20+
align {
21+
preset = some
22+
openParenDefnSite = false
23+
openParenCallSite = false
24+
}
25+
docstrings.style = Asterisk
26+
docstrings.wrap = fold
27+
optIn.configStyleArguments = false
28+
spaces {
29+
inImportCurlyBraces = false
30+
}
31+
continuationIndent.defnSite = 4
32+
runner.optimizer.maxVisitsPerToken = 15000

LICENSE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Source code in this repository is variously licensed under the Business Source License 1.1 (BSL) and the Apache 2.0 license.
2+
A copy of each license can be found in the licenses directory.
3+
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.

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1-
# das-sqlite
1+
# DAS SQLite
2+
[![License](https://img.shields.io/:license-BSL%201.1-blue.svg)](/licenses/BSL.txt)
3+
4+
[Data Access Service](https://github.com/raw-labs/protocol-das) for SQLite.
5+
6+
## Options
7+
8+
| Name | Description | Default | Required |
9+
|------------|---------------------------------------|----------|----------|
10+
| `database` | The path to the SQLite database | | Yes |
11+
12+
## How to use
13+
14+
First you need to build the project:
15+
```bash
16+
$ sbt "project docker" "docker:publishLocal"
17+
```
18+
19+
This will create a docker image with the name `das-excel`.
20+
21+
Then you can run the image with the following command:
22+
```bash
23+
$ docker run -p 50051:50051 <image_id>
24+
```
25+
... where `<image_id>` is the id of the image created in the previous step.
26+
This will start the server, typically on port 50051.
27+
28+
You can find the image id by looking at the sbt output or by running:
29+
```bash
30+
$ docker images
31+
```

0 commit comments

Comments
 (0)