Skip to content

Commit 9fee42d

Browse files
committed
Infrastructure: Use plugin to run tests, setup Actions
1 parent 5e034af commit 9fee42d

5 files changed

Lines changed: 43 additions & 13 deletions

File tree

.github/workflows/main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: build-and-test
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-and-test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: olafurpg/setup-scala@v10
13+
with:
14+
java-version: adopt@1.8
15+
- run: sbt -v update compile
16+
- run: sbt -v test

build.sbt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
enablePlugins(org.nlogo.build.NetLogoExtension, org.nlogo.build.ExtensionDocumentationPlugin)
1+
import org.nlogo.build.{ ExtensionDocumentationPlugin, NetLogoExtension }
22

3-
javaSource in Compile := baseDirectory.value / "src"
3+
enablePlugins(NetLogoExtension)
4+
enablePlugins(ExtensionDocumentationPlugin)
45

5-
name := "array"
6+
scalaVersion := "2.12.12"
67

7-
version := "1.1.1"
8+
name := "array"
9+
version := "1.1.1"
10+
isSnapshot := true
811

912
netLogoClassManager := "org.nlogo.extensions.array.ArrayExtension"
13+
netLogoVersion := "6.2.2"
1014

11-
netLogoTarget :=
12-
org.nlogo.build.NetLogoExtension.directoryTarget(baseDirectory.value)
13-
14-
javacOptions ++= Seq("-g", "-deprecation", "-Xlint:all", "-Xlint:-serial", "-Xlint:-path",
15-
"-encoding", "us-ascii")
16-
17-
resolvers += "netlogo" at "https://dl.cloudsmith.io/public/netlogo/netlogo/maven/"
18-
netLogoVersion := "6.2.0-d27b502"
15+
javaSource in Compile := baseDirectory.value / "src" / "main"
16+
scalaSource in Test := baseDirectory.value / "src" / "test"
17+
javacOptions ++= Seq("-g", "-deprecation", "-Xlint:all", "-Xlint:-serial", "-Xlint:-path", "-encoding", "us-ascii")

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ resolvers ++= Seq(
33
, "netlogo-extension-documentation" at "https://dl.cloudsmith.io/public/netlogo/netlogo-extension-documentation/maven/"
44
)
55

6-
addSbtPlugin("org.nlogo" % "netlogo-extension-plugin" % "3.2")
6+
addSbtPlugin("org.nlogo" % "netlogo-extension-plugin" % "5.2.0")
77
addSbtPlugin("org.nlogo" % "netlogo-extension-documentation" % "0.8.3")

src/test/Tests.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// (C) Uri Wilensky. https://github.com/NetLogo/Python-Extension
2+
3+
package org.nlogo.extensions.py
4+
5+
import java.io.File
6+
import org.nlogo.headless.TestLanguage
7+
8+
object Tests {
9+
val testFileNames = Seq("tests.txt")
10+
val testFiles = testFileNames.map( (f) => (new File(f)).getCanonicalFile )
11+
}
12+
13+
class Tests extends TestLanguage(Tests.testFiles) {
14+
System.setProperty("org.nlogo.preferHeadless", "true")
15+
}

0 commit comments

Comments
 (0)