Windows #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Windows | |
on: | |
push: | |
branches: [ master, '*-ci' ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
build_windows: | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: ["windows-latest"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 8 | |
- name: Build Zserio Java Service Rmi | |
run: | | |
# download the latest zserio version | |
mvn dependency:copy -Dmaven.repo.local="build/download" \ | |
-Dartifact=io.github.ndsev:zserio:LATEST \ | |
-DoutputDirectory="build" -Dmdep.stripVersion=true | |
# download the latest zserio runtime version | |
mvn dependency:copy -Dmaven.repo.local="build/download" \ | |
-Dartifact=io.github.ndsev:zserio-runtime:LATEST \ | |
-DoutputDirectory="build" -Dmdep.stripVersion=true | |
# generate example using Zserio | |
java -jar build/zserio.jar \ | |
-src examples/zserio/service/rmi/examples/calculator calculator.zs -java build \ | |
-setTopLevelPackage rmi.examples.calculator.gen | |
# compile example | |
javac -d build -cp build/zserio-runtime.jar \ | |
src/zserio/service/rmi/*.java \ | |
examples/zserio/service/rmi/examples/calculator/*.java \ | |
build/rmi/examples/calculator/gen/calculator/*.java | |
shell: bash | |
- name: Test Zserio Java Service Rmi | |
run: | | |
SERVICE_CLASSPATH="build/zserio-runtime.jar;build" | |
java -cp "${SERVICE_CLASSPATH}" zserio.service.rmi.examples.calculator.CalculatorServer & | |
sleep 10 | |
{ echo "p"; sleep 1; echo "100"; sleep 1; echo "q"; } | java -cp "${SERVICE_CLASSPATH}" \ | |
zserio.service.rmi.examples.calculator.CalculatorClient | grep "10000" | |
{ echo "s"; sleep 1; echo "100"; sleep 1; echo "q"; } | java -cp "${SERVICE_CLASSPATH}" \ | |
zserio.service.rmi.examples.calculator.CalculatorClient | grep "10.0" | |
kill $(jobs -p) | |
shell: bash | |
- name: Archive Zserio Java Service Rmi classes | |
uses: actions/upload-artifact@v3 | |
with: | |
name: zserio-service-rmi-java-${{matrix.os}} | |
path: | | |
build/rmi/**/*.class | |
build/zserio/**/*.class | |
build/*.jar |