Skip to content
This repository was archived by the owner on Apr 23, 2026. It is now read-only.
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
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Keep copied ungrammar file on LF so build.rs byte comparisons stay stable across OSes.
rust.ungram text eol=lf

# Also the auto-generated RustNodeSyntax.scala
scala_tests/src/main/scala/io/joern/rust2cpg/parser/RustNodeSyntax.scala text eol=lf
23 changes: 22 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,32 @@ jobs:
- name: Run tests
run: cargo test --locked

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: sbt
cache-dependency-path: |
scala_tests/build.sbt
scala_tests/project/build.properties

- name: Set up sbt
uses: sbt/setup-sbt@v1

- name: Regenerate Scala bindings
run: cargo run --locked --bin scala_bindings_gen -- --include-date=false --output scala_tests/src/main/scala/io/joern/rust2cpg/parser/RustNodeSyntax.scala

- name: Run Scala tests
working-directory: scala_tests
shell: bash
run: sbt test

- name: Check if there are changes
shell: bash
run: |
if [[ -n "$(git status --porcelain --untracked-files=no)" ]]; then
echo "::error title=Repository modified by CI::Did you forget to commit rust.ungram?"
echo "::error title=Repository modified by CI::Did you forget to commit regenerated files such as rust.ungram or RustNodeSyntax.scala?"
echo "Changes:"
git status --short
exit 1
Expand Down
7 changes: 7 additions & 0 deletions scala_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.bsp/
.idea/
.coursier/
.sbt-boot/
.sbt-global/
project/target/
target/
12 changes: 12 additions & 0 deletions scala_tests/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

ThisBuild / scalaVersion := "3.7.4"

lazy val root = (project in file("."))
.settings(
name := "scala_tests",
// Versions chosen to match the versions used by joern.
libraryDependencies ++= Seq(
"com.lihaoyi" %% "upickle" % "4.0.2",
"org.scalatest" %% "scalatest" % "3.2.18" % Test
)
)
1 change: 1 addition & 0 deletions scala_tests/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version = 1.12.9
Loading
Loading