Skip to content
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
27 changes: 1 addition & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,13 @@ on:
branches: ["master"]
pull_request:
branches: ["**"]
types: [opened, reopened, synchronize, labeled, unlabeled]
types: [opened, reopened, synchronize]
workflow_dispatch:

jobs:
require-label:
name: Require Run CI label
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Ensure Run CI label is present
env:
HAS_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'Run CI') }}
run: |
if [ "${HAS_LABEL}" != "true" ]; then
echo "::error::Add the 'Run CI' label to this pull request to trigger CI."
exit 1
fi
shell: bash

build-and-check:
name: Build & Check (${{ matrix.os }}-${{ matrix.mpi }})
runs-on: ${{ matrix.os }}
needs: [require-label]
if: github.event_name != 'pull_request' || needs.require-label.result == 'success'
strategy:
matrix:
include:
Expand Down Expand Up @@ -136,8 +119,6 @@ jobs:
code-formatting:
name: Check Code Formatting
runs-on: ubuntu-latest
needs: [require-label]
if: github.event_name != 'pull_request' || needs.require-label.result == 'success'
steps:
- name: Checkout sources
uses: actions/checkout@v6
Expand Down Expand Up @@ -171,8 +152,6 @@ jobs:
mixed-precision-check:
name: Check Mixed-Precision Code
runs-on: ubuntu-latest
needs: [require-label]
if: github.event_name != 'pull_request' || needs.require-label.result == 'success'
steps:
- name: Checkout sources
uses: actions/checkout@v6
Expand Down Expand Up @@ -200,8 +179,6 @@ jobs:
headers-check:
name: Check Headers
runs-on: ubuntu-latest
needs: [require-label]
if: github.event_name != 'pull_request' || needs.require-label.result == 'success'
steps:
- name: Checkout sources
uses: actions/checkout@v6
Expand All @@ -228,8 +205,6 @@ jobs:
code-checks:
name: Code Checks (${{ matrix.check }})
runs-on: ubuntu-latest
needs: [require-label]
if: github.event_name != 'pull_request' || needs.require-label.result == 'success'
strategy:
fail-fast: false
matrix:
Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/conda-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Conda Release Publish

on:
release:
types: [published]
workflow_dispatch:
inputs:
release_tag:
description: Release tag to publish (for example v3.1.0)
required: true
type: string

jobs:
build-and-publish:
name: Publish (${{ matrix.os }} | mpi=${{ matrix.mpi }}, openmp=${{ matrix.openmp }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
mpi: [nompi, openmpi, mpich]
openmp: [on, off]

steps:
- name: Checkout sources
uses: actions/checkout@v6
with:
ref: ${{ github.event.release.tag_name || github.event.inputs.release_tag }}

- name: Resolve package version from release tag
id: version
shell: bash
env:
RELEASE_TAG: ${{ github.event.release.tag_name || github.event.inputs.release_tag }}
run: |
set -euo pipefail
if [ -z "${RELEASE_TAG:-}" ]; then
echo "::error::Release tag is empty."
exit 1
fi
version="${RELEASE_TAG#refs/tags/}"
version="${version#v}"
if ! [[ "${version}" =~ ^[0-9]+(\.[0-9]+){1,3}([A-Za-z0-9._-]+)?$ ]]; then
echo "::error::Unsupported release tag '${RELEASE_TAG}'. Use tags like v3.1.0 or 3.1.0."
exit 1
fi
echo "version=${version}" >> "${GITHUB_OUTPUT}"
echo "Using package version ${version}"
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: conda-build-env
auto-update-conda: false
channels: conda-forge
channel-priority: strict
python-version: "3.12"

- name: Install conda tooling
shell: bash -el {0}
run: |
conda install -n conda-build-env -y conda-build anaconda-client
- name: Build package variant
shell: bash -el {0}
env:
CONDA_BLD_PATH: ${{ runner.temp }}/conda-bld
HYPRE_VERSION: ${{ steps.version.outputs.version }}
run: |
set -euo pipefail
echo "Building version=${HYPRE_VERSION}, mpi=${{ matrix.mpi }}, openmp=${{ matrix.openmp }}"
variant_json=$(printf '{"mpi":["%s"],"openmp":["%s"]}' "${{ matrix.mpi }}" "${{ matrix.openmp }}")
conda build conda-recipe \
--channel conda-forge \
--override-channels \
--variants "${variant_json}" \
--no-anaconda-upload
- name: Upload package to Anaconda (opflow-dev)
shell: bash -el {0}
env:
CONDA_BLD_PATH: ${{ runner.temp }}/conda-bld
HYPRE_VERSION: ${{ steps.version.outputs.version }}
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
run: |
set -euo pipefail
if [ -z "${ANACONDA_API_TOKEN:-}" ]; then
echo "::error::Missing secret ANACONDA_API_TOKEN."
exit 1
fi
pkg_files="$(
find "${CONDA_BLD_PATH}" -type f \
\( -name "hypre-${HYPRE_VERSION}-*.conda" -o -name "hypre-${HYPRE_VERSION}-*.tar.bz2" \) \
| sort
)"
if [ -z "${pkg_files}" ]; then
echo "::error::No built packages found under ${CONDA_BLD_PATH}."
exit 1
fi
echo "Uploading packages:"
printf '%s\n' "${pkg_files}"
while IFS= read -r pkg; do
[ -n "${pkg}" ] || continue
anaconda -t "${ANACONDA_API_TOKEN}" upload \
--user opflow-dev \
--label main \
--skip-existing \
"${pkg}"
done <<< "${pkg_files}"
5 changes: 5 additions & 0 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env bash
# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

set -euxo pipefail

HYPRE_ENABLE_MPI="${HYPRE_ENABLE_MPI:-OFF}"
Expand Down
5 changes: 5 additions & 0 deletions conda-recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

mpi:
- nompi
- openmpi
Expand Down
8 changes: 7 additions & 1 deletion conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

{% set enable_mpi = "ON" if mpi != "nompi" else "OFF" %}
{% set enable_openmp = "ON" if openmp == "on" else "OFF" %}
{% set package_version = (environ.get("HYPRE_VERSION") or "3.1.0").lstrip("v") %}

package:
name: hypre
version: 3.1.0
version: {{ package_version }}

source:
path: ..
Expand Down
Loading