Skip to content

Commit

Permalink
Split autotools into two jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF committed Sep 12, 2023
1 parent 8254347 commit 8d2512f
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 115 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/autotools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ jobs:
name: "Autotools Debug Thread-Safety Workflows"
uses: ./.github/workflows/main-auto.yml
with:
thread_safety: true
thread_safety: enable
build_mode: "debug"

call-release-thread-autotools:
name: "Autotools Release Thread-Safety Workflows"
uses: ./.github/workflows/main-auto.yml
with:
thread_safety: true
thread_safety: enable
build_mode: "production"

call-debug-autotools:
name: "Autotools Debug Workflows"
uses: ./.github/workflows/main-auto.yml
with:
thread_safety: false
thread_safety: disable
build_mode: "debug"

call-release-autotools:
name: "Autotools Release Workflows"
uses: ./.github/workflows/main-auto.yml
with:
thread_safety: false
thread_safety: disable
build_mode: "production"

call-release-auto-intel:
Expand Down
200 changes: 89 additions & 111 deletions .github/workflows/main-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_call:
inputs:
thread_safety:
description: "thread-safety on/off"
description: "thread-safety enable/disable"
required: true
type: boolean
build_mode:
Expand All @@ -22,70 +22,10 @@ permissions:
jobs:

# A workflow that builds the library and runs all the tests
# Linux (Ubuntu) w/ gcc + Autotools
#
Autotools_build_and_test:
strategy:
# The current matrix has one dimensions:
#
# * config name
#
# Most configuration information is added via the 'include' mechanism,
# which will append the key-value pairs in the configuration where the
# names match.
matrix:
name:
- "gcc"
- "gcc parallel (build only)"

# This is where we list the bulk of the options for each configuration.
# The key-value pair values are usually appropriate for being CMake or
# Autotools configure values, so be aware of that.

include:

# Linux (Ubuntu) w/ gcc + Autotools
#
# Keep this identical to the CMake configs. Note the difference in
# the values.
- name: "gcc"
os: ubuntu-latest
cpp: enable
fortran: enable
java: enable
docs: disable
parallel: disable
mirror_vfd: enable
direct_vfd: enable
ros3_vfd: enable
deprec_sym: enable
default_api: v114
szip: yes
flags: ""
run_tests: true

# Parallel Linux (Ubuntu) w/ gcc + Autotools
#
# The GitHub runners are inadequate for running parallel HDF5 tests,
# so we catch most issues in daily testing. What we have here is just
# a compile check to make sure nothing obvious is broken.
- name: "gcc parallel (build only)"
os: ubuntu-latest
cpp: disable
fortran: enable
java: disable
docs: disable
parallel: enable
mirror_vfd: disable
direct_vfd: disable
ros3_vfd: disable
deprec_sym: enable
default_api: v114
szip: yes
flags: "CC=mpicc"
run_tests: false

# Sets the job's name from the properties
name: "${{ matrix.name }}-${{ inputs.build_mode }}-TS=${{ inputs.thread_safety }}"

name: "GCC-${{ inputs.build_mode }}-TS=${{ inputs.thread_safety }}d"
# Don't run the action if the commit message says to skip CI
if: "!contains(github.event.head_commit.message, 'skip-ci')"

Expand All @@ -94,43 +34,18 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

#
# SETUP
#

#Useful for debugging
- name: Dump matrix context
run: echo '${{ toJSON(matrix) }}'

# Only CMake need ninja-build, but we just install it unilaterally
# libssl, etc. are needed for the ros3 VFD
- name: Install Linux Dependencies
run: |
sudo apt update
sudo apt-get install ninja-build doxygen graphviz
sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev
sudo apt install gcc-12 g++-12 gfortran-12
sudo apt install automake autoconf libtool libtool-bin
sudo apt install libaec0 libaec-dev
echo "CC=gcc-12" >> $GITHUB_ENV
echo "CXX=g++-12" >> $GITHUB_ENV
echo "FC=gfortran-12" >> $GITHUB_ENV
if: matrix.os == 'ubuntu-latest'

- name: Install Autotools Dependencies (Linux)
run: |
sudo apt install automake autoconf libtool libtool-bin
sudo apt install libaec0 libaec-dev
- name: Install Autotools Dependencies (Linux, parallel)
run: |
sudo apt install openmpi-bin openmpi-common mpi-default-dev
echo "CC=mpicc" >> $GITHUB_ENV
echo "FC=mpif90" >> $GITHUB_ENV
if: (matrix.parallel == 'enable')

- name: Install Dependencies (macOS)
run: brew install ninja doxygen
if: matrix.os == 'macos-13'
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
Expand All @@ -142,38 +57,41 @@ jobs:
sh ./autogen.sh
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
${{ matrix.flags }} $GITHUB_WORKSPACE/configure \
$GITHUB_WORKSPACE/configure \
--enable-build-mode=${{ inputs.build_mode }} \
--${{ matrix.deprec_sym }}-deprecated-symbols \
--with-default-api-version=${{ matrix.default_api }} \
--enable-deprecated-symbols \
--with-default-api-version=v114 \
--enable-shared \
--${{ matrix.parallel }}-parallel \
--${{ matrix.cpp }}-cxx \
--${{ matrix.fortran }}-fortran \
--${{ matrix.java }}-java \
--${{ matrix.mirror_vfd }}-mirror-vfd \
--${{ matrix.direct_vfd }}-direct-vfd \
--${{ matrix.ros3_vfd }}-ros3-vfd \
--with-szlib=${{ matrix.szip }}
--disable-parallel \
--{{ inputs.thread_safety }}-threadsafe \
--enable-cxx \
--enable-fortran \
--enable-java \
--enable-mirror-vfd \
--enable-direct-vfd \
--enable-ros3-vfd \
--with-szlib=yes
shell: bash
working-directory: ${{ runner.workspace }}/build
if: "! (inputs.thread_safety)"

- name: Autotools Configure (Thread-Safe)
run: |
sh ./autogen.sh
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
${{ matrix.flags }} $GITHUB_WORKSPACE/configure \
$GITHUB_WORKSPACE/configure \
--enable-build-mode=${{ inputs.build_mode }} \
--enable-shared \
--enable-threadsafe \
--{{ inputs.thread_safety }}-threadsafe \
--disable-hl \
--${{ matrix.parallel }}-parallel \
--${{ matrix.mirror_vfd }}-mirror-vfd \
--${{ matrix.direct_vfd }}-direct-vfd \
--${{ matrix.ros3_vfd }}-ros3-vfd \
--with-szlib=${{ matrix.szip }}
--disable-parallel \
--enable-mirror-vfd \
--enable-direct-vfd \
--enable-ros3-vfd \
--with-szlib=yes
shell: bash
working-directory: ${{ runner.workspace }}/build
if: (inputs.thread_safety)

# BUILD
Expand All @@ -186,15 +104,15 @@ jobs:
- name: Autotools Run Tests
run: make check -j2
working-directory: ${{ runner.workspace }}/build
if: (matrix.run_tests) && ! (inputs.thread_safety)
if: "! (inputs.thread_safety)"

# THREAD-SAFE
- name: Autotools Run Thread-Safe Tests
run: |
cd test
./ttsafe
working-directory: ${{ runner.workspace }}/build
if: (matrix.run_tests) && (inputs.thread_safety)
if: (inputs.thread_safety)

# INSTALL (note that this runs even when we don't run the tests)
- name: Autotools Install
Expand All @@ -203,4 +121,64 @@ jobs:

- name: Autotools Verify Install
run: make check-install

#
# The GitHub runners are inadequate for running parallel HDF5 tests,
# so we catch most issues in daily testing. What we have here is just
# a compile check to make sure nothing obvious is broken.
# A workflow that builds the library
# Parallel Linux (Ubuntu) w/ gcc + Autotools
#
Autotools_build_parallel:
name: "Parallel GCC-${{ inputs.build_mode }}-TS=${{ inputs.thread_safety }}d"
# Don't run the action if the commit message says to skip CI
if: "!contains(github.event.head_commit.message, 'skip-ci')"

# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# SETUP
- name: Install Linux Dependencies
run: |
sudo apt update
sudo apt-get install ninja-build doxygen graphviz
sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev
sudo apt install gcc-12 g++-12 gfortran-12
sudo apt install automake autoconf libtool libtool-bin
sudo apt install libaec0 libaec-dev
sudo apt install openmpi-bin openmpi-common mpi-default-dev
echo "CC=mpicc" >> $GITHUB_ENV
echo "FC=mpif90" >> $GITHUB_ENV
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
uses: actions/checkout@v4

# AUTOTOOLS CONFIGURE
- name: Autotools Configure
run: |
sh ./autogen.sh
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
CC=mpicc $GITHUB_WORKSPACE/configure \
--enable-build-mode=${{ inputs.build_mode }} \
--enable-deprecated-symbols \
--with-default-api-version=v114 \
--enable-shared \
--enable-parallel \
--disable-cxx \
--enable-fortran \
--disable-java \
--disable-mirror-vfd \
--disable-direct-vfd \
--disable-ros3-vfd \
--with-szlib=yes
shell: bash
working-directory: ${{ runner.workspace }}/build

# BUILD
- name: Autotools Build
run: make -j3
working-directory: ${{ runner.workspace }}/build

0 comments on commit 8d2512f

Please sign in to comment.