Terminate the process in a workflow #4
This file contains hidden or 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: Native Image What_the_Dickens Pipeline | |
| on: | |
| push: | |
| paths: | |
| - 'native-image/what-the-dickens/lab/**' | |
| - '.github/workflows/github-actions-what-the-dickens.yml' | |
| jobs: | |
| build: | |
| name: Native Image What_the_Dickens on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: graalvm/setup-graalvm@v1 | |
| with: | |
| java-version: '24' | |
| distribution: 'graalvm' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and Test Java Code | |
| run: | | |
| cd native-image/what-the-dickens/lab/ | |
| # Build a JAR | |
| ./mvnw --no-transfer-progress clean package | |
| # Generate reachability metadata with the Tracing agent | |
| java -Dpring.aot.enabled=true \ | |
| -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image/ \ | |
| -jar target/what_the_dickens-0.0.1-SNAPSHOT.jar | |
| pid=$! | |
| sleep 10 | |
| kill $pid | |
| # Build a native image | |
| ./mvnw --no-transfer-progress -Pnative -DskipTests=true package | |
| # Build a regular dynamic native image and containerize in docker.io/oraclelinux:8-slim container | |
| ./mvnw clean | |
| docker build -f ./01-native-image/Dockerfile \ | |
| -t what_the_dickens:native.01 . | |
| # Build a mostly-static native image and containerize in gcr.io/distroless/base container | |
| ./mvnw clean | |
| docker build -f ./02-smaller-containers/Dockerfile \ | |
| -t what_the_dickens:distroless.01 . | |
| # List container images | |
| docker images | head -n2 |