Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync master #148

Merged
merged 14 commits into from
Aug 17, 2023
Prev Previous commit
Next Next commit
Update windows CI
  • Loading branch information
byrnHDF committed Aug 1, 2023
commit 4752cdb849ce40bd1afc9e22a4ceca96c892bee0
126 changes: 125 additions & 1 deletion .github/workflows/ant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
repo: 'HDFGroup/hdf5'
#version: 'tags/1.14.2'
#file: 'hdf5-1_14_2-ubuntu-2204.tar.gz'
version: 'tags/snapshot'
version: 'tags/snapshot-1.14'
file: '${{ needs.get-base-names.outputs.hdf5-name }}-ubuntu-2204.tar.gz'

- name: List files for the space (Linux)
Expand Down Expand Up @@ -143,6 +143,130 @@ jobs:
path: ${{ github.workspace }}/build/dist/HDFView-99.99.99-Linux-x86_64.tar.gz
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

- name: Test with Ant
env:
HDFLIBS: ${{ steps.set-hdflib-name.outputs.HDFLIB_ENV }}
HDF5LIBS: ${{ steps.set-hdf5lib-name.outputs.HDF5LIB_ENV }}
run: ant -noinput -buildfile build.xml junit

build-win:
runs-on: windows-latest
needs: get-base-names
name: "Windows MSVC"

steps:
- uses: actions/checkout@v3

- name: Set up JDK 19
uses: actions/setup-java@v3
with:
java-version: '19'
distribution: 'temurin'

- name: Get hdf4 release
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'HDFGroup/hdf4'
#version: 'tags/hdf-4_2_16-2'
#file: 'hdf-4_2_16-2-win_vs2022.zip'
version: 'tags/snapshot'
file: '${{ needs.get-base-names.outputs.hdf4-name }}-win_vs2022.zip'

- name: Uncompress gh binary (Win)
run: 7z x ${{ github.workspace }}/${{ needs.get-base-names.outputs.hdf4-name }}-win_vs2022.zip

- name: Uncompress hdf4 binary (Win)
working-directory: ${{ github.workspace }}/hdf4
run: 7z x HDF-*-win64.zip
shell: bash

- name: List files for the space (Win)
run: |
ls -l ${{ github.workspace }}/hdf4
ls ${{ runner.workspace }}/hdfview

- name: create hdf4 location (Win)
working-directory: ${{ github.workspace }}/hdf4
run: |
New-Item -Path "${{ github.workspace }}/HDF_Group/HDF" -ItemType Directory
Copy-Item -Path "${{ github.workspace }}/hdf4/HDF*/*" -Destination "${{ github.workspace }}/HDF_Group/HDF" -Recurse
shell: pwsh

- name: List files for the space (Win)
run: ls -l ${{ github.workspace }}/HDF_Group/HDF

- name: set hdflib name
id: set-hdflib-name
run: |
HDFDIR="${{ github.workspace }}/HDF_Group/HDF"
echo "HDFLIB_ENV=$HDFDIR" >> $GITHUB_OUTPUT
shell: bash

- name: Get hdf5 release
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'HDFGroup/hdf5'
#version: 'tags/1.14.2'
#file: 'hdf5-1_14_2-win_vs2022.zip'
version: 'tags/snapshot-1.14'
file: '${{ needs.get-base-names.outputs.hdf5-name }}-win_vs2022.zip'

- name: Uncompress gh binary (Win)
run: 7z x ${{ github.workspace }}/${{ needs.get-base-names.outputs.hdf5-name }}-win_vs2022.zip

- name: Uncompress hdf5 binary (Win)
working-directory: ${{ github.workspace }}/hdf5
run: 7z x HDF5-*-win64.zip
shell: bash

- name: List files for the space (Win)
run: |
ls -l ${{ github.workspace }}/hdf5
ls ${{ runner.workspace }}/hdfview

- name: create hdf5 location (Win)
working-directory: ${{ github.workspace }}/hdf5
run: |
New-Item -Path "${{ github.workspace }}/HDF_Group/HDF5" -ItemType Directory
Copy-Item -Path "${{ github.workspace }}/hdf5/HDF*/*" -Destination "${{ github.workspace }}/HDF_Group/HDF5" -Recurse
shell: pwsh

- name: List files for the space (Win)
run: ls -l ${{ github.workspace }}/HDF_Group/HDF5

- name: set hdf5lib name
id: set-hdf5lib-name
run: |
HDF5DIR="${{ github.workspace }}/HDF_Group/HDF5"
echo "HDF5LIB_ENV=$HDF5DIR" >> $GITHUB_OUTPUT
shell: bash

- name: List files for the binaries (Win)
run: |
ls -l ${{ github.workspace }}/HDF_Group/HDF
ls -l ${{ github.workspace }}/HDF_Group/HDF5

- name: Build with Ant
env:
HDFLIBS: ${{ steps.set-hdflib-name.outputs.HDFLIB_ENV }}
HDF5LIBS: ${{ steps.set-hdf5lib-name.outputs.HDF5LIB_ENV }}
run: ant -noinput -buildfile build.xml binaryPackage
shell: bash

- name: List files for the space (Windows)
run: |
Get-ChildItem -Path ${{ github.workspace }}
Get-ChildItem -Path ${{ github.workspace }}/build
shell: pwsh

# Save files created by ctest script
- name: Save published binary (Win)
uses: actions/upload-artifact@v3
with:
name: zip-win-2022-binary
path: ${{ github.workspace }}/build/dist/HDFView-3.3.99-win64.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

- name: Test with Ant
env:
HDFLIBS: ${{ steps.set-hdflib-name.outputs.HDFLIB_ENV }}
Expand Down
45 changes: 24 additions & 21 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:fx="javafx:com.sun.javafx.tools.ant"
xmlns:sonar="antlib:org.sonar.ant"
xmlns:jacoco="antlib:org.jacoco.ant"
xmlns:doxygen="antlib:org.doxygen.tools"
xmlns:if="ant:if"
xmlns:unless="ant:unless">
<property environment="env" />
Expand Down Expand Up @@ -485,7 +486,7 @@
<os family="mac" />
</condition>

<target name="rundebug" depends="jar" description="Runs the application with remote debugger">
<target name="rundebug" depends="deploy,jar" description="Runs the application with remote debugger">
<mkdir dir="${jar.dir}/lib/ext" />
<java fork="true" classname="${main-class}">
<jvmarg value="-Dorg.slf4j.simpleLogger.defaultLogLevel=${build.log.level.run}" />
Expand All @@ -498,15 +499,15 @@
<path refid="hdfobject-jar" />
<path refid="application" />
</classpath>
<sysproperty key="java.library.path" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}" />
<sysproperty key="java.library.path" path="${release.dir}/bin${path.separator}${release.dir}/bin" />
<sysproperty key="hdfview.root" path="${basedir}/${jar.dir}" />
<!-- <sysproperty key="hdfview.workdir" path="${basedir}/${jar.dir}" /> -->
<env key="HDF5_PLUGIN_PATH" path="${hdf5.plugin.dir}" />
<env key="${platform.hdf.lib}" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}${path.separator}${platform.hdf.lib}" />
<env key="${platform.hdf.lib}" path="${release.dir}/bin${path.separator}${release.dir}/bin${path.separator}${platform.hdf.lib}" />
</java>
</target>

<target name="run" depends="jar" description="Runs the application">
<target name="run" depends="deploy,jar" description="Runs the application">
<mkdir dir="${jar.dir}/lib/ext" />
<java fork="true" classname="${main-class}">
<jvmarg value="-Dorg.slf4j.simpleLogger.defaultLogLevel=${build.log.level.run}" />
Expand All @@ -518,11 +519,11 @@
<path refid="hdfobject-jar" />
<path refid="application" />
</classpath>
<sysproperty key="java.library.path" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}" />
<sysproperty key="java.library.path" path="${release.dir}/bin${path.separator}${release.dir}/bin" />
<sysproperty key="hdfview.root" path="${basedir}/${jar.dir}" />
<!-- <sysproperty key="hdfview.workdir" path="${basedir}/${jar.dir}" /> -->
<env key="HDF5_PLUGIN_PATH" path="${hdf5.plugin.dir}" />
<env key="${platform.hdf.lib}" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}${path.separator}${platform.hdf.lib}" />
<env key="${platform.hdf.lib}" path="${release.dir}/bin${path.separator}${release.dir}/bin${path.separator}${platform.hdf.lib}" />
</java>
</target>

Expand Down Expand Up @@ -558,7 +559,7 @@
<fileset dir="${exclasses.dir}" includes="**/*.class" excludes="**/*$* **/*.txt testfiles/**" />
</target>

<target name="run-one-example" depends="compile-test" description="Runs one example">
<target name="run-one-example" depends="deploy,compile-test" description="Runs one example">
<dirname property="exfile.dir" file="${build.exfile}" />
<basename property="exdir.name" file="${exfile.dir}" />
<basename property="exfile.name" file="${build.exfile}" suffix=".class" />
Expand All @@ -575,8 +576,8 @@
<pathelement location="${classes.dir}" />
<pathelement path="${exclasses.dir}" />
</classpath>
<sysproperty key="java.library.path" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}" />
<env key="${platform.hdf.lib}" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}${path.separator}${platform.hdf.lib}" />
<sysproperty key="java.library.path" path="${release.dir}/bin${path.separator}${release.dir}/bin" />
<env key="${platform.hdf.lib}" path="${release.dir}/bin${path.separator}${release.dir}/bin${path.separator}${platform.hdf.lib}" />
</java>
</target>

Expand Down Expand Up @@ -682,7 +683,7 @@
<property name="agentvmparam" value="" />
</target>

<target name="junit-debug-test" depends="objectjar,clean-junit-uitest,compile-test,jacoco">
<target name="junit-debug-test" depends="deploy,objectjar,clean-junit-uitest,compile-test,jacoco">
<mkdir dir="${report.dir}" />
<junit showoutput="yes" enabletestlistenerevents="true" fork="yes" printsummary="withOutAndErr" dir="${classes.dir}">
<jvmarg value="-Dorg.slf4j.simpleLogger.defaultLogLevel=${build.log.level.test}" />
Expand All @@ -695,15 +696,15 @@
<path refid="build-classpath" />
<pathelement location="${testclasses.dir}" />
</classpath>
<sysproperty key="java.library.path" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}" />
<env key="${platform.hdf.lib}" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}${path.separator}${platform.hdf.lib}" />
<sysproperty key="java.library.path" path="${release.dir}/bin${path.separator}${release.dir}/bin" />
<env key="${platform.hdf.lib}" path="${release.dir}/bin${path.separator}${release.dir}/bin${path.separator}${platform.hdf.lib}" />
<test name="${build.object.test}" todir="${report.dir}" outfile="TEST-${build.object.test}">
<formatter type="plain" />
</test>
</junit>
</target>

<target name="junit-single-test" depends="objectjar,clean-junit-uitest,compile-test,jacoco">
<target name="junit-single-test" depends="deploy,objectjar,clean-junit-uitest,compile-test,jacoco">
<mkdir dir="${report.dir}" />
<junit showoutput="yes" enabletestlistenerevents="true" fork="yes" printsummary="withOutAndErr" dir="${classes.dir}">
<jvmarg value="-Dorg.slf4j.simpleLogger.defaultLogLevel=${build.log.level.test}" />
Expand All @@ -714,15 +715,15 @@
<path refid="build-classpath" />
<pathelement location="${testclasses.dir}" />
</classpath>
<sysproperty key="java.library.path" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}" />
<env key="${platform.hdf.lib}" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}${path.separator}${platform.hdf.lib}" />
<sysproperty key="java.library.path" path="${release.dir}/bin${path.separator}${release.dir}/bin" />
<env key="${platform.hdf.lib}" path="${release.dir}/bin${path.separator}${release.dir}/bin${path.separator}${platform.hdf.lib}" />
<test name="${build.object.test}" todir="${report.dir}" outfile="TEST-${build.object.test}">
<formatter type="plain" />
</test>
</junit>
</target>

<target name="junit" depends="objectjar,clean-junit-uitest,compile-test,jacoco" description="Runs the Object Library tests">
<target name="junit" depends="deploy,objectjar,clean-junit-uitest,compile-test,jacoco" description="Runs the Object Library tests">
<mkdir dir="${report.dir}" />
<junit showoutput="yes" enabletestlistenerevents="true" fork="yes" printsummary="withOutAndErr" dir="${classes.dir}">
<jvmarg value="-Dorg.slf4j.simpleLogger.defaultLogLevel=${build.log.level.test}" />
Expand All @@ -733,8 +734,8 @@
<path refid="build-classpath" />
<pathelement location="${testclasses.dir}" />
</classpath>
<sysproperty key="java.library.path" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}" />
<env key="${platform.hdf.lib}" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}${path.separator}${platform.hdf.lib}" />
<sysproperty key="java.library.path" path="${release.dir}/bin${path.separator}${release.dir}/bin" />
<env key="${platform.hdf.lib}" path="${release.dir}/bin${path.separator}${release.dir}/bin${path.separator}${platform.hdf.lib}" />

<formatter type="xml" />
<formatter type="plain" />
Expand Down Expand Up @@ -811,11 +812,11 @@
<pathelement location="${uitestclasses.dir}" />
</classpath>

<sysproperty key="java.library.path" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}" />
<sysproperty key="java.library.path" path="${release.dir}/bin${path.separator}${release.dir}/bin" />
<sysproperty key="hdfview.root" path="@{rootdir}" />
<sysproperty key="hdfview.workdir" path="@{workdir}" />
<sysproperty key="hdfview.propfile" path="@{propfile}" />
<env key="${platform.hdf.lib}" path="${hdf.lib.dir}${path.separator}${hdf5.lib.dir}${path.separator}${platform.hdf.lib}" />
<env key="${platform.hdf.lib}" path="${release.dir}/bin${path.separator}${release.dir}/bin${path.separator}${platform.hdf.lib}" />

<test name="uitest.${test}" todir="${report.dir}" outfile="TEST-uitest.${test}">
<formatter type="xml" />
Expand Down Expand Up @@ -1182,6 +1183,7 @@
<include name="hdf_java.dll" />
</fileset>
<fileset dir="${hdf.lib.dir}/../bin">
<include name="hdf_java.dll" />
<include name="hdf.dll"/>
<include name="mfhdf.dll"/>
<include name="xdr.dll"/>
Expand All @@ -1191,6 +1193,7 @@
<include name="hdf5_java.dll" />
</fileset>
<fileset dir="${hdf5.lib.dir}/../bin">
<include name="hdf5_java.dll" />
<include name="hdf5.dll"/>
</fileset>
</copy>
Expand Down Expand Up @@ -1657,7 +1660,7 @@
<attrib file="${basedir}\${dist.dir}\${ant.project.name}-${app.version}.exe" readonly="false" />
<echo message="xxxx Sign the windows binary xxxx"/>
<!-- Sign the generated exe -->
<exec executable="${env.SIGNTOOLDIR}\signtool.exe">
<exec executable="${env.SIGNTOOLDIR}\signtool.exe" failifexecutionfails="false">
<arg value="sign" />
<arg value="/v" />
<arg value="/debug" />
Expand Down
Loading