Skip to content

Commit

Permalink
Merge pull request #24 from byrnHDF/master-ci
Browse files Browse the repository at this point in the history
Add working CI
  • Loading branch information
byrnHDF authored Aug 16, 2023
2 parents 510507f + eb55072 commit 3f32223
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 64 deletions.
59 changes: 54 additions & 5 deletions .github/workflows/cmake-ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
- 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
Expand All @@ -81,7 +80,6 @@ jobs:

- name: List files for the binaries (Win)
run: |
ls -l ${{ github.workspace }}/HDF_Group/HDF
ls -l ${{ github.workspace }}/HDF_Group/HDF5
- name: Set file base name (Windows)
Expand Down Expand Up @@ -114,8 +112,11 @@ jobs:
shell: bash

- name: Run ctest (Windows)
env:
HDF5_ROOT: ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}
HDF5_PLUGIN_PATH: ${{ steps.set-hdf5lib-name.outputs.HDF5_PLUGIN_PATH }}
run: |
cd "${{ runner.workspace }}/hdf-examples/hdfsrc"
cd "${{ runner.workspace }}/hdf5-examples/hdfsrc"
cmake --workflow --preset=ci-StdShar-MSVC --fresh
shell: bash

Expand Down Expand Up @@ -192,8 +193,11 @@ jobs:
run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz

- name: Run ctest (Linux)
env:
HDF5_ROOT: ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}
HDF5_PLUGIN_PATH: ${{ steps.set-hdf5lib-name.outputs.HDF5_PLUGIN_PATH }}
run: |
cd "${{ runner.workspace }}/hdf-examples/hdfsrc"
cd "${{ runner.workspace }}/hdf5-examples/hdfsrc"
cmake --workflow --preset=ci-StdShar-GNUC --fresh
shell: bash

Expand All @@ -206,6 +210,48 @@ jobs:
- name: Install Dependencies (MacOS)
run: brew install ninja doxygen

- uses: actions/checkout@v3

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

- 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-osx12.tar.gz'
version: 'tags/snapshot'
file: '${{ inputs.use_hdf }}-osx12.tar.gz'

- name: List files for the space (MacOS)
run: |
ls -l ${{ github.workspace }}
ls ${{ runner.workspace }}
- name: Uncompress gh binary (MacOS)
run: tar -zxvf ${{ github.workspace }}/${{ inputs.use_hdf }}-osx12.tar.gz

- name: Uncompress hdf5 binary (MacOS)
run: |
cd "${{ github.workspace }}/hdf5"
tar -zxvf ${{ github.workspace }}/hdf5/HDF5-*-Darwin.tar.gz --strip-components 1
- name: set hdf5lib name
id: set-hdf5lib-name
run: |
HDF5DIR=${{ github.workspace }}/hdf5/HDF_Group/HDF5/
FILE_NAME_HDF5=$(ls ${{ github.workspace }}/hdf5/HDF_Group/HDF5)
echo "HDF5_ROOT=$HDF5DIR$FILE_NAME_HDF5" >> $GITHUB_OUTPUT
echo "HDF5_PLUGIN_PATH=$HDF5_ROOT/lib/plugin" >> $GITHUB_OUTPUT
- name: List files for the binaries (MacOS)
run: |
ls -l ${{ github.workspace }}/hdf5/HDF_Group/HDF5
- name: Set file base name (MacOS)
id: set-file-base
run: |
Expand Down Expand Up @@ -233,8 +279,11 @@ jobs:

- name: Run ctest (MacOS)
id: run-ctest
env:
HDF5_ROOT: ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}
HDF5_PLUGIN_PATH: ${{ steps.set-hdf5lib-name.outputs.HDF5_PLUGIN_PATH }}
run: |
cd "${{ runner.workspace }}/hdf5/hdfsrc"
cd "${{ runner.workspace }}/hdf5-examples/hdfsrc"
cmake --workflow --preset=ci-StdShar-Clang --fresh
shell: bash

25 changes: 0 additions & 25 deletions .github/workflows/release-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,6 @@ jobs:
name: zip-tarball
path: ${{ github.workspace }}

# Get files created by cmake-ctest script
- name: Get published binary (Windows)
uses: actions/download-artifact@v3
with:
name: zip-vs2022-binary
path: ${{ github.workspace }}

- name: Get published binary (MacOS)
uses: actions/download-artifact@v3
with:
name: tgz-osx12-binary
path: ${{ github.workspace }}

- name: Get published binary (Linux)
uses: actions/download-artifact@v3
with:
name: tgz-ubuntu-2204-binary
path: ${{ github.workspace }}

- name: Store snapshot name
run: |
echo "${{ steps.get-file-base.outputs.FILE_BASE }}" > ./last-file.txt
Expand All @@ -120,9 +101,6 @@ jobs:
last-file.txt
${{ steps.get-file-base.outputs.FILE_BASE }}.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}.zip
${{ steps.get-file-base.outputs.FILE_BASE }}-osx12.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}-win_vs2022.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- name: Release tag
Expand All @@ -136,9 +114,6 @@ jobs:
files: |
${{ steps.get-file-base.outputs.FILE_BASE }}.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}.zip
${{ steps.get-file-base.outputs.FILE_BASE }}-osx12.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}-win_vs2022.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- name: List files for the space (Linux)
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,16 @@ jobs:
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
shell: bash

- name: Create source file (tgz)
id: create-file-tgz
- name: List files in the repository
run: |
cd "$GITHUB_WORKSPACE/hdfsrc"
tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz
shell: bash
ls -l ${{ github.workspace }}
ls $GITHUB_WORKSPACE
- name: Create source file (zip)
id: create-file-zip
- name: Create source file (tgz and zip)
id: create-files
run: |
cd "$GITHUB_WORKSPACE/hdfsrc"
zip -r ${{ steps.set-file-base.outputs.FILE_BASE }}.zip ./${{ steps.set-file-base.outputs.FILE_BASE }}
zip -r ${{ steps.set-file-base.outputs.FILE_BASE }}.zip ./hdfsrc
tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz ./hdfsrc
shell: bash

- name: List files in the repository
Expand Down
50 changes: 26 additions & 24 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,29 @@
"cacheVariables": {
"CPACK_PACKAGE_VERSION": "2.0.4",
"HDF5_NAMESPACE": {"type": "STRING", "value": "hdf5::"},
"HDF5_PACKAGE_NAME": {"type": "STRING", "value": "hdf5"}
"HDF5_PACKAGE_NAME": {"type": "STRING", "value": "hdf5"},
"BUILD_TESTING": "ON"
}
},
{
"name": "ci-StdJava",
"hidden": true,
"cacheVariables": {
"HDF_BUILD_JAVA": "ON"
}
},
{
"name": "ci-StdFortran",
"hidden": true,
"cacheVariables": {
"HDF_BUILD_FORTRAN": "ON"
}
},
{
"name": "ci-StdPlugins",
"hidden": true,
"cacheVariables": {
"HDF_BUILD_FILTERS": "ON"
}
},
{
Expand Down Expand Up @@ -97,49 +119,29 @@
]
}
],
"packagePresets": [
{
"name": "ci-StdShar-MSVC",
"configurePreset": "ci-StdShar-MSVC",
"inherits": "ci-x64-Release-MSVC"
},
{
"name": "ci-StdShar-Clang",
"configurePreset": "ci-StdShar-Clang",
"inherits": "ci-x64-Release-Clang"
},
{
"name": "ci-StdShar-GNUC",
"configurePreset": "ci-StdShar-GNUC",
"inherits": "ci-x64-Release-GNUC"
}
],
"workflowPresets": [
{
"name": "ci-StdShar-MSVC",
"steps": [
{"type": "configure", "name": "ci-StdShar-MSVC"},
{"type": "build", "name": "ci-StdShar-MSVC"},
{"type": "test", "name": "ci-StdShar-MSVC"},
{"type": "package", "name": "ci-StdShar-MSVC"}
{"type": "test", "name": "ci-StdShar-MSVC"}
]
},
{
"name": "ci-StdShar-Clang",
"steps": [
{"type": "configure", "name": "ci-StdShar-Clang"},
{"type": "build", "name": "ci-StdShar-Clang"},
{"type": "test", "name": "ci-StdShar-Clang"},
{"type": "package", "name": "ci-StdShar-Clang"}
{"type": "test", "name": "ci-StdShar-Clang"}
]
},
{
"name": "ci-StdShar-GNUC",
"steps": [
{"type": "configure", "name": "ci-StdShar-GNUC"},
{"type": "build", "name": "ci-StdShar-GNUC"},
{"type": "test", "name": "ci-StdShar-GNUC"},
{"type": "package", "name": "ci-StdShar-GNUC"}
{"type": "test", "name": "ci-StdShar-GNUC"}
]
}
]
Expand Down
3 changes: 2 additions & 1 deletion config/cmake-presets/hidden-presets.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
{
"name": "ci-base",
"displayName": "Basic Config",
"description": "Basic build using default generator",
"description": "Basic build using Ninja generator",
"generator": "Ninja",
"hidden": true,
"binaryDir": "${sourceParentDir}/build/${presetName}",
"installDir": "${sourceParentDir}/install/${presetName}"
Expand Down

0 comments on commit 3f32223

Please sign in to comment.