Update github/codeql-action digest to ff2f1c6 #971
Workflow file for this run
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: Samples | |
| on: | |
| push: | |
| pull_request: | |
| permissions: read-all | |
| jobs: | |
| build: | |
| name: Run ${{ matrix.sample }} on ${{ matrix.os }} (GraalVM ${{ matrix.java }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - 'ubuntu-latest' | |
| - 'windows-latest' | |
| java: | |
| - 21 | |
| sample: | |
| - 'simple' | |
| - 'xml' | |
| - 'sqlprovider' | |
| - 'scan' | |
| - 'dao' | |
| - 'thymeleaf' | |
| - 'thymeleaf-sqlgenerator' | |
| - 'velocity' | |
| - 'freemarker' | |
| - 'cache' | |
| - 'configuration' | |
| - 'dynamic-sql' | |
| fail-fast: false | |
| max-parallel: 10 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - name: Set up GraalVM | |
| uses: graalvm/setup-graalvm@5298d94fb55a4f185c602eeac5de1b553882abe2 # v1 | |
| with: | |
| version: 'dev' | |
| java-version: ${{ matrix.java }} | |
| components: 'native-image' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cache local Maven repository | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-samples-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven-samples- | |
| - name: Print environments | |
| run: | | |
| echo "GRAALVM_HOME: $GRAALVM_HOME" | |
| echo "JAVA_HOME: $JAVA_HOME" | |
| java --version | |
| native-image --version | |
| - name: Build native image | |
| run: ./mvnw -pl core,extensions,samples/${{ matrix.sample }} -U -D"maven.test.skip" -Pnative -D"license.skip=true" clean package -B -V --no-transfer-progress | |
| - name: Run with native image | |
| run: ./samples/${{ matrix.sample }}/target/mybatis-spring-native-sample-${{ matrix.sample }} | |
| - name: Run with executable jar on AOT mode | |
| run: java -DspringAot=true -jar ./samples/${{ matrix.sample }}/target/mybatis-spring-native-sample-${{ matrix.sample }}-exec.jar | |
| - name: Run with executable jar | |
| run: java -jar ./samples/${{ matrix.sample }}/target/mybatis-spring-native-sample-${{ matrix.sample }}-exec.jar | |
| - name: Verify running with native image for ubuntu | |
| if: ${{ matrix.os == 'ubuntu-latest' && matrix.sample != 'cache' }} | |
| run: | | |
| ./samples/${{ matrix.sample }}/target/mybatis-spring-native-sample-${{ matrix.sample }} --logging.pattern.console="[%level] %m%n" --spring.main.banner-mode=off --logging.level.org.mybatis.spring.nativex.sample=off | tee actual-console.log | |
| diff actual-console.log ./samples/${{ matrix.sample }}/src/test/resources/expected-console.log | |
| - name: Verify running with native image for ubuntu | |
| if: ${{ matrix.os == 'ubuntu-latest' && matrix.sample == 'cache' }} | |
| run: | | |
| ./samples/${{ matrix.sample }}/target/mybatis-spring-native-sample-${{ matrix.sample }} --logging.pattern.console="[%level] %m%n" --spring.main.banner-mode=off --logging.level.org.mybatis.spring.nativex.sample=off -Djdk.serialFilter='org.mybatis.spring.nativex.sample.cache.*;java.util.*;java.lang.*;!*' | tee actual-console.log | |
| diff actual-console.log ./samples/${{ matrix.sample }}/src/test/resources/expected-console.log |