Skip to content

Linux

Linux #10

Workflow file for this run

name: Linux
on:
push:
branches: [ master, '*-ci' ]
pull_request:
branches: [ master ]
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
jobs:
build_linux:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04"]
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
- 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)
- 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