1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-19 19:55:09 +00:00
plantuml/.github/workflows/native-image.yml

54 lines
1.9 KiB
YAML
Raw Normal View History

2023-03-19 13:50:06 +00:00
name: Native Image
on:
workflow_call:
inputs:
release-version:
required: true
type: string
2023-03-19 13:50:06 +00:00
jobs:
native_image_linux:
2023-03-19 13:50:06 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- uses: actions/cache/restore@v3
with:
path: |
build/libs
build/publications
key: "libs-${{ runner.os }}-${{ github.run_id }}"
fail-on-cache-miss: true
2023-03-19 13:50:06 +00:00
- name: Install system requirements
run: sudo apt install build-essential libz-dev zlib1g-dev
- name: Get GraalVM
run: |
wget "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${GRAALVM_VERSION}/graalvm-ce-java17-linux-amd64-${GRAALVM_VERSION}.tar.gz" -O graalvm-ce.tar.gz
mkdir graalvm-ce
tar xvzf graalvm-ce.tar.gz -C graalvm-ce --strip-components 1
./graalvm-ce/bin/gu install native-image
env:
GRAALVM_VERSION: "22.3.1"
- name: Generate GraalVM configuration
run: |
mkdir native-image-config-dir
echo 'Bob->Alice: Hello' | ./graalvm-ce/bin/java -agentlib:native-image-agent=config-output-dir=./native-image-config-dir -jar "./build/libs/plantuml-${RELEASE_VERSION}.jar" -tpng -pipe > out.png
env:
RELEASE_VERSION: ${{ inputs.release-version }}
2023-03-19 13:50:06 +00:00
- name: Generate native image
run: |
./graalvm-ce/bin/native-image -H:ConfigurationFileDirectories=./native-image-config-dir --no-fallback --report-unsupported-elements-at-runtime -jar "./build/libs/plantuml-${RELEASE_VERSION}.jar" "./build/libs/plantuml-linux-amd64-${RELEASE_VERSION}"
env:
RELEASE_VERSION: ${{ inputs.release-version }}
2023-03-19 13:50:06 +00:00
- name: Cache native image
uses: actions/cache/save@v3
2023-03-19 13:50:06 +00:00
with:
path: build/libs/plantuml-linux-amd64-*
key: "native-image-linux-${{ runner.os }}-${{ github.run_id }}"