Skip to content

Commit aaea53b

Browse files
chore: switch to SBT and fix docs ci (#52)
* Switch to SBT and fix docs ci * Fix CI * Fix "bad substitution error" * docs CI * docs CI * docs CI
1 parent ebc5fc6 commit aaea53b

File tree

14 files changed

+250
-736
lines changed

14 files changed

+250
-736
lines changed

.github/workflows/ci-jvm.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ jobs:
1313
java-version: '11'
1414
distribution: 'temurin'
1515
architecture: x64
16+
cache: sbt
17+
18+
- name: Set up SBT
19+
uses: sbt/setup-sbt@v1
20+
with:
21+
sbt-runner-version: 1.9.9
1622

1723
- name: Check codestyle
1824
run: |
19-
mvn --no-transfer-progress spotless:check
25+
sbt root/scalafmtCheckAll
2026
working-directory: tsumugi-server
2127

2228
- name: Run tests
2329
run: |
24-
mvn --no-transfer-progress test
30+
sbt root/test
2531
working-directory: tsumugi-server
2632

.github/workflows/docs.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@ jobs:
3535
git config user.email 'github-actions[bot]@users.noreply.github.com'
3636
3737
- name: Build and Deploy
38-
run:
39-
poetry run -C ${{ github.workspace }}/tsumugi-python mkdocs gh-deploy --force
38+
run: |
39+
cd tsumugi-python
40+
export VENV_ROOT=$(poetry env info --path)
41+
cd ..
42+
$VENV_ROOT/bin/mkdocs gh-deploy --force

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121
java-version: '11'
2222
distribution: 'adopt'
2323

24+
- name: Set up SBT
25+
uses: sbt/setup-sbt@v1
26+
with:
27+
sbt-runner-version: 1.9.9
28+
2429
- name: Set up Python
2530
if: startsWith(github.ref, 'refs/tags/')
2631
uses: actions/setup-python@v5
@@ -31,10 +36,10 @@ jobs:
3136
if: startsWith(github.ref, 'refs/tags/')
3237
uses: snok/install-poetry@v1
3338

34-
- name: Build server with Maven
39+
- name: Build server with SBT
3540
if: startsWith(github.ref, 'refs/tags/')
36-
# Inspired by https://stackoverflow.com/a/51559900
37-
run: mvn -Drevision=${{ github.ref_name }} -DskipTests --no-transfer-progress clean package
41+
run: |
42+
sbt -Drevision=${{ github.ref_name }} assemblyWithDeequ
3843
working-directory: tsumugi-server
3944

4045
- name: Build client with poetry
@@ -51,7 +56,7 @@ jobs:
5156
draft: false
5257
prerelease: false
5358
files: |
54-
tsumugi-server/target/tsumugi-server-*.jar
59+
tsumugi-server/withDeequ/scala-2.12/target/tsumugi-server-*.jar
5560
tsumugi-python/dist/tsumugi-*.tar.gz
5661
env:
5762
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

dev/run-connect.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import sys
66
from pathlib import Path
77

8-
MVN_BUILD_COMMAND = ["mvn", "clean", "-DskipTests", "package"]
9-
SPARK_VERSION = "3.5.2"
8+
SBT_BUILD_COMMAND = ["sbt", "assemblyWithDeequ"]
9+
SPARK_VERSION = "3.5.4"
1010
SCALA_VERSION = "2.12"
11-
TSUMUGI_VERSION = "1.0-SNAPSHOT"
11+
TSUMUGI_VERSION = "0.1.0-SNAPSHOT"
1212

1313

1414
if __name__ == "__main__":
@@ -17,18 +17,18 @@
1717

1818
print("Build Tsumugi...")
1919
os.chdir(scala_root)
20-
build_mvn = subprocess.run(
21-
MVN_BUILD_COMMAND,
20+
build_sbt = subprocess.run(
21+
SBT_BUILD_COMMAND,
2222
stdout=subprocess.PIPE,
2323
universal_newlines=True,
2424
)
2525

26-
if build_mvn.returncode == 0:
26+
if build_sbt.returncode == 0:
2727
print("Done.")
2828
else:
29-
print(f"MVN build return an error: {build_mvn.returncode}")
30-
print("stdout: ", build_mvn.stdout)
31-
print("stderr: ", build_mvn.stderr)
29+
print(f"SBT build return an error: {build_sbt.returncode}")
30+
print("stdout: ", build_sbt.stdout)
31+
print("stderr: ", build_sbt.stderr)
3232
sys.exit(1)
3333

3434
tmp_dir = prj_root.joinpath("tmp")
@@ -82,7 +82,9 @@
8282
os.chdir(spark_home)
8383

8484
tsumugi_jar = (
85-
scala_root.joinpath("target")
85+
scala_root.joinpath("withDeequ")
86+
.joinpath("target")
87+
.joinpath(f"scala-{SCALA_VERSION}")
8688
.joinpath(f"tsumugi-server-{TSUMUGI_VERSION}.jar")
8789
)
8890
shutil.copyfile(tsumugi_jar, spark_home.joinpath(tsumugi_jar.name))

tsumugi-python/tsumugi/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@
44
proto_root = Path(__file__).parent.joinpath("proto")
55
if str(proto_root.absolute()) not in sys.path:
66
sys.path.append(str(proto_root.absolute()))
7+
8+
# We must me sure that all the protobuf packages are loaded!
9+
# An order is also important!
10+
from tsumugi.proto import repository_pb2 # noqa: E402, F401
11+
from tsumugi.proto import analyzers_pb2 # noqa: E402, F401
12+
from tsumugi.proto import strategies_pb2 # noqa: E402, F401

tsumugi-python/tsumugi/proto/analyzers_pb2.py

Lines changed: 74 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsumugi-python/tsumugi/proto/repository_pb2.py

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsumugi-python/tsumugi/proto/strategies_pb2.py

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)