Skip to content

Commit

Permalink
ci: test run-groovy
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Sep 19, 2023
1 parent f098b46 commit fe561d6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
24 changes: 23 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
retention-days: 1
path: coatjava.tar.gz

test:
test_coatjava:
needs: [ build ]
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -73,3 +73,25 @@ jobs:
run: |
cd validation/advanced-tests
${{matrix.cmd}}
test_run-groovy:
needs: [ build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: zulu
- name: setup groovy
uses: wtfjoke/setup-groovy@v1
with:
groovy-version: 4.x
- uses: actions/download-artifact@v3
with:
name: build
- name: untar build
run: tar xzvf coatjava.tar.gz
- name: test run-groovy
run: coatjava/bin/run-groovy validation/advanced-tests/test-run-groovy.groovy
17 changes: 17 additions & 0 deletions validation/advanced-tests/test-run-groovy.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// simple test to make sure that `run-groovy` is working

// check environment variables
[ 'JYPATH', 'JAVA_OPTS' ].collectEntries{ [it, System.getenv(it)] }.each{ name, val ->
if(val==null) {
System.err.println "ERROR: environment variable $name not set"
System.exit(100)
}
if(val=="") {
System.err.println "ERROR: environment variable $name is set, but empty"
System.exit(100)
}
System.out.println("$name = $val")
}

// try to import a local package
import org.jlab.clas.physics.*

0 comments on commit fe561d6

Please sign in to comment.