Remove or make use of unused code (#14) #182
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: Maven Package | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- api: jdk | |
build_jdk: crac | |
- api: javax | |
build_jdk: crac | |
- api: org | |
build_jdk: | |
steps: | |
- name: Install prerequisites | |
run: | |
sudo | |
DEBIAN_FRONTEND=noninteractive | |
apt-get -y --no-install-recommends install | |
siege | |
- uses: actions/checkout@v3 | |
- name: Checkout utils | |
uses: actions/checkout@v3 | |
with: | |
repository: CRaC/utils | |
path: utils | |
- run: make -C utils | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 8 | |
distribution: 'zulu' | |
cache: 'maven' | |
- name: Download JDK | |
run: | | |
archive=$(utils/download-jdk.sh) | |
sudo tar -axf $archive | |
echo JDK=${archive%%.tar.gz} >> $GITHUB_ENV | |
- name: Use specific API | |
if: matrix.api != 'org' | |
run: | | |
find -name '*.java' | xargs sed -i 's/org\.crac/${{ matrix.api }}.crac/g' | |
git diff | |
- run: | | |
if [ ${{ matrix.build_jdk }} = crac ]; then | |
export JAVA_HOME=${{ env.JDK }} | |
fi | |
mvn -B package -P${{ matrix.api }} | |
- name: Test on Vanila JDK | |
run: | | |
P=$(utils/start-bg.sh \ | |
-s "Server:main: Started" \ | |
java -jar target/example-jetty-1.0-SNAPSHOT.jar) | |
curl localhost:8080 | grep "Hello World" | |
utils/bench.sh http://localhost:8080 | |
kill $P | |
if: matrix.api == 'org' | |
- name: Prepare warm checkpoint | |
run: | | |
P=$(utils/start-bg.sh \ | |
-s "Server:main: Started" \ | |
-e exitcode \ | |
${{ env.JDK }}/bin/java \ | |
-XX:CRaCCheckpointTo=cr \ | |
-XX:+UnlockDiagnosticVMOptions \ | |
-XX:+CRTraceStartupTime \ | |
-Djdk.crac.trace-startup-time=true \ | |
-jar target/example-jetty-1.0-SNAPSHOT.jar) | |
# warmup the service | |
utils/bench.sh http://localhost:8080 | |
jcmd $P JDK.checkpoint | |
[ 137 = $(utils/read-exitcode.sh exitcode) ] | |
- name: Test on C/RaC | |
run: | | |
P=$(utils/start-bg.sh \ | |
-s "restore-finish" \ | |
${{ env.JDK }}/bin/java -XX:CRaCRestoreFrom=cr) | |
curl localhost:8080 | grep "Hello World" | |
utils/bench.sh http://localhost:8080 | |
kill $P | |
- name: Test C/RaC startup time | |
run: | |
timeout 3 bash -c "utils/lib/javatime ; ${{ env.JDK }}/bin/java -XX:CRaCRestoreFrom=cr" | |
| utils/sel.awk -v from=prestart -v to=restore-finish |