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

Add preset files #23

Merged
merged 4 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
240 changes: 240 additions & 0 deletions .github/workflows/cmake-ctest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
name: hdf5 examples ctest runs

# Controls when the action will run. Triggers the workflow on a schedule
on:
workflow_call:
inputs:
use_hdf:
description: "The hdf5 base name of the binaries"
required: true
type: string
file_base:
description: "The common base name of the source tarballs"
required: true
type: string

permissions:
contents: read

# A workflow run is made up of one or more jobs that can run sequentially or
# in parallel
jobs:
build_and_test_win:
# Windows w/ MSVC + CMake
#
name: "Windows MSVC CTest"
runs-on: windows-latest
steps:
- name: Install Dependencies (Windows)
run: choco install ninja

- uses: actions/checkout@v3

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

- name: Enable Developer Command Prompt
uses: ilammy/[email protected]

- 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'
file: '${{ inputs.use_hdf }}-win_vs2022.zip'

- name: Uncompress gh binary (Win)
run: 7z x ${{ github.workspace }}/${{ inputs.use_hdf }}-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 "HDF5_ROOT=$HDF5DIR$FILE_NAME_HDF5" >> $GITHUB_OUTPUT
echo "HDF5_PLUGIN_PATH=$HDF5_ROOT/lib/plugin" >> $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: Set file base name (Windows)
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
shell: bash

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

- name: using powershell
shell: pwsh
run: Get-Location

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

- name: Uncompress source (Windows)
working-directory: ${{ github.workspace }}
run: 7z x ${{ steps.set-file-base.outputs.FILE_BASE }}.zip
shell: bash

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

build_and_test_linux:
# Linux (Ubuntu) w/ gcc + CMake
#
name: "Ubuntu gcc CMake"
runs-on: ubuntu-latest
steps:
- name: Install CMake Dependencies (Linux)
run: sudo apt-get install ninja-build doxygen graphviz

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

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

- name: Uncompress gh binary (Linux)
run: tar -zxvf ${{ github.workspace }}/${{ inputs.use_hdf }}-ubuntu-2204.tar.gz

- name: Uncompress hdf5 binary (Linux)
run: |
cd "${{ github.workspace }}/hdf5"
tar -zxvf ${{ github.workspace }}/hdf5/HDF5-*-Linux.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 (Linux)
run: |
ls -l ${{ github.workspace }}/hdf5/HDF_Group/HDF5

- name: Set file base name (Linux)
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT

# Get files created by release script
- name: Get tgz-tarball (Linux)
uses: actions/download-artifact@v3
with:
name: tgz-tarball
path: ${{ github.workspace }}

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

- name: Uncompress source (Linux)
run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz

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

build_and_test_mac:
# MacOS w/ Clang + CMake
#
name: "MacOS Clang CMake"
runs-on: macos-11
steps:
- name: Install Dependencies (MacOS)
run: brew install ninja doxygen

- name: Set file base name (MacOS)
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT

# Get files created by release script
- name: Get tgz-tarball (MacOS)
uses: actions/download-artifact@v3
with:
name: tgz-tarball
path: ${{ github.workspace }}

- name: List files for the space (MacOS)
run: |
ls ${{ github.workspace }}
ls ${{ runner.workspace }}

- name: Uncompress source (MacOS)
run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz

# symlinks the compiler executables to a common location
- name: Setup GNU Fortran
uses: modflowpy/install-gfortran-action@v1

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

64 changes: 64 additions & 0 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: hdf5 examples daily build

# Controls when the action will run. Triggers the workflow on a schedule
on:
workflow_dispatch:
# push:
# branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

# A workflow run is made up of one or more jobs that can run sequentially or
# in parallel.
jobs:
get-base-names:
runs-on: ubuntu-latest
outputs:
hdf5-name: ${{ steps.gethdf5base.outputs.HDF5_NAME_BASE }}

steps:
- uses: actions/checkout@v3

- name: Get hdf5 release base name
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'HDFGroup/hdf5'
version: 'tags/snapshot'
file: 'last-file.txt'

- name: Read base-name file
id: gethdf5base
run: echo "HDF5_NAME_BASE=$(cat last-file.txt)" >> $GITHUB_OUTPUT

call-workflow-tarball:
uses: ./.github/workflows/tarball.yml
with:
#use_tag: snapshot
use_environ: snapshots

call-workflow-ctest:
needs: [get-base-names, call-workflow-tarball]
uses: ./.github/workflows/cmake-ctest.yml
with:
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
use_hdf: ${{ needs.get-base-names.outputs.hdf5-name }}
#use_tag: snapshot
#use_environ: snapshots
if: ${{ needs.call-workflow-tarball.outputs.has_changes == 'true' }}

call-workflow-release:
needs: [call-workflow-tarball, call-workflow-ctest]
permissions:
contents: write # In order to allow tag creation
uses: ./.github/workflows/release-files.yml
with:
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
file_branch: ${{ needs.call-workflow-tarball.outputs.file_branch }}
file_sha: ${{ needs.call-workflow-tarball.outputs.file_sha }}
use_tag: snapshot
use_environ: snapshots
if: ${{ needs.call-workflow-tarball.outputs.has_changes == 'true' }}

Loading