.github/workflows/compile-native.yml #14
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: Compile VCell to Native Code | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| CompileAndUpload: | |
| name: VCell Core on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| working-directory: vcell-nativelib | |
| strategy: | |
| matrix: | |
| os: [macos-13, windows-latest, ubuntu-latest, macos-14] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: setup graalvm for static native build | |
| uses: graalvm/setup-graalvm@v1 | |
| with: | |
| java-version: '23' | |
| distribution: 'graalvm-community' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| components: 'native-image' | |
| # native-image-musl: 'true' # Now semi-static by not including libc | |
| native-image-job-reports: 'true' | |
| - name: build entire project | |
| run: | | |
| pushd .. | |
| mvn clean install dependency:copy-dependencies -DskipTests=true | |
| popd | |
| - name: test, record, and build native exectuable | |
| run: | | |
| mvn test | |
| java -Dheadless=true -agentlib:native-image-agent=config-output-dir=target/recording \ | |
| -jar target/vcell-nativelib-0.0.1-SNAPSHOT.jar \ | |
| "src/test/resources/TinySpacialProject_Application0.xml" \ | |
| "target/sbml-input" | |
| mvn -P shared-dll -DskipTests=true package | |
| mvn -P native -DskipTests=true package | |
| if: matrix.os != 'windows-latest' | |
| - name: test, record, and build native exectuable | |
| run: | | |
| mvn test | |
| java -Dheadless=true -agentlib:native-image-agent=config-output-dir=target\recording -jar target\vcell-nativelib-0.0.1-SNAPSHOT.jar "src\test\resources\TinySpacialProject_Application0.xml" "target\sbml-input" | |
| mvn -P shared-dll -DskipTests=true package | |
| mvn -P native -DskipTests=true package | |
| if: matrix.os == 'windows-latest' | |
| - name: zip up DLLs and native executable | |
| run: | | |
| mkdir vcell-${{ matrix.os }} | |
| mv target/graal_isolate* vcell-${{ matrix.os }} | |
| mv target/sbml_to* vcell-${{ matrix.os }} | |
| zip -r vcell-${{ matrix.os }}.zip vcell-${{ matrix.os }} | |
| if: matrix.os != 'windows-latest' | |
| - name: zip up DLLs and native executable | |
| run: | | |
| mkdir vcell-${{ matrix.os }} | |
| mv target\graal_isolate* vcell-${{ matrix.os }} | |
| mv target\sbml_to* vcell-${{ matrix.os }} | |
| tar -acf vcell-${{ matrix.os }}.zip vcell-${{ matrix.os }} | |
| if: matrix.os == 'windows-latest' | |
| - name: upload DLLs and executables | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vcell-${{ matrix.os }} | |
| path: | | |
| ~/work/vcell/vcell/vcell-nativelib/vcell-${{ matrix.os }}.zip | |
| if-no-files-found: error | |
| include-hidden-files: true | |
| - name: Setup tmate session | |
| uses: mxschmitt/action-tmate@v3 | |
| if: ${{ failure() }} |