diff --git a/.github/Dockerfile/base-catch2.Dockerfile b/.github/Dockerfile/base-catch2.Dockerfile deleted file mode 100644 index 8a10b0479..000000000 --- a/.github/Dockerfile/base-catch2.Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2023 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ARG PARENT_IMAGE_NAME - -FROM ${PARENT_IMAGE_NAME}:latest - -ARG CATCH2_VERSION - -# Install catch2 ## -RUN cd /tmp \ - && git clone -b v${CATCH2_VERSION} https://github.com/catchorg/Catch2.git \ - && cd Catch2 \ - && cmake -Bbuild -H. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/install \ - && cmake --build build \ - && cmake --build build --target install \ - && rm -rf /tmp/Catch2 diff --git a/.github/Dockerfile/base-libboost.Dockerfile b/.github/Dockerfile/base-libboost.Dockerfile deleted file mode 100644 index 7a4782a4b..000000000 --- a/.github/Dockerfile/base-libboost.Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -ARG PARENT_IMAGE_NAME - -FROM ${PARENT_IMAGE_NAME}:latest - -ARG LIBBOOST_VERSION - -# Install libboost ## -RUN apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y libboost-all-dev \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* diff --git a/.github/Dockerfile/base-libfort.Dockerfile b/.github/Dockerfile/base-libfort.Dockerfile deleted file mode 100644 index af93edb7c..000000000 --- a/.github/Dockerfile/base-libfort.Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -ARG PARENT_IMAGE_NAME - -FROM ${PARENT_IMAGE_NAME}:latest - -ARG LIBFORT_VERSION - -# Install curl to download libfort -RUN apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y curl \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Install libfort# -ENV INSTALL_PATH=../install - -RUN curl -L -o libfort-${LIBFORT_VERSION}.tar.gz https://codeload.github.com/seleznevae/libfort/tar.gz/refs/tags/v${LIBFORT_VERSION} \ - && tar -zxf libfort-${LIBFORT_VERSION}.tar.gz \ - && cd libfort-${LIBFORT_VERSION} \ - && cmake -GNinja -H. -Bbuild -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} \ - && cmake --build build \ - && cmake --build build --target install \ - && cd .. \ - && rm -rf libfort-${LIBFORT_VERSION} libfort-${LIBFORT_VERSION}.tar.gz - -ENV PATH="`pwd`/install:${PATH}" diff --git a/.github/actions/container-build_test_release/action.yaml b/.github/actions/container-build_test_release/action.yaml deleted file mode 100644 index 10703a3dd..000000000 --- a/.github/actions/container-build_test_release/action.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2023 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: container action to build ParallelZone - -description: container action from the base image to build ParallelZone - -inputs: - base_tag: - description: 'tag of the base image' - type: string - required: false - default: 'stable' - dep_repo_tag: - description: 'tag of the dependent repo images' - type: string - required: false - default: '' - token: - type: string - required: true - user: - type: string - required: true - cmake_version: - type: string - required: false - default: '' - gcc_version: - type: string - required: false - default: '' - clang_version: - type: string - required: false - default: '' - ninja_build: - type: boolean - required: true - use_clang: - type: boolean - required: true - CMAIZE_GITHUB_TOKEN: - type: string - required: true - INSTALL: - type: boolean - required: true - test: - type: boolean - required: true - integration_test: - type: boolean - required: true - branch_name: - type: string - required: true -runs: - using: 'docker' - image: 'Dockerfile' - args: - - ${{ inputs.token }} # 1 - - ${{ inputs.user }} # 2 - - ${{ inputs.base_tag }} # 3 - - ${{ inputs.cmake_version }} # 4 - - ${{ inputs.gcc_version }} # 5 - - ${{ inputs.clang_version }} # 6 - - ${{ inputs.ninja_build }} # 7 - - ${{ inputs.use_clang }} # 8 - - ${{ inputs.CMAIZE_GITHUB_TOKEN }} # 9 - - ${{ inputs.INSTALL }} # 10 - - ${{ inputs.test }} # 11 - - ${{ inputs.integration_test }} # 12 - - ${{ inputs.branch_name }} # 13 - - ${{ inputs.dep_repo_tag }} # 14 diff --git a/.github/actions/container-build_test_release/docker-action/Dockerfile b/.github/actions/container-build_test_release/docker-action/Dockerfile deleted file mode 100644 index 1dc1cd096..000000000 --- a/.github/actions/container-build_test_release/docker-action/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2023 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -ARG dep_repo_tag -ARG base_tag - -FROM ghcr.io/nwchemex-project/release_parallelzone:$dep_repo_tag -FROM ghcr.io/nwchemex-project/release_utilities:$dep_repo_tag - -FROM ghcr.io/nwchemex-project/base_pluginplay:$base_tag - -COPY --from=0 /install /install - -COPY --from=1 /install /install - -COPY build_test.sh /build_test.sh - -RUN ["chmod", "+x", "/build_test.sh"] - -ARG cmake_version -ARG gcc_version -ARG clang_version -ARG ninja_build -ARG use_clang -ARG cmaize_github_token -ARG install -ARG unit_test -ARG int_test -ARG branch_name - - -ENV env_cmake_version=$cmake_version -ENV env_gcc_version=$gcc_version -ENV env_clang_version=$clang_version -ENV env_ninja_build=$ninja_build -ENV env_use_clang=$use_clang -ENV env_cmaize_github_token=$cmaize_github_token -ENV env_install=$install -ENV env_unit_test=$unit_test -ENV env_int_test=$int_test -ENV env_branch_name=$branch_name - -ENTRYPOINT ["/build_test.sh"] diff --git a/.github/actions/container-build_test_release/docker-action/build_test.sh b/.github/actions/container-build_test_release/docker-action/build_test.sh deleted file mode 100644 index d2f429ae2..000000000 --- a/.github/actions/container-build_test_release/docker-action/build_test.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/sh -# Copyright 2023 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# Wraps the process for configuring, building, and testing an NWX repo -# -# Usage: -# build_test.sh -# -# Other variables: -# cmake_version: the version of cmake being used in the format x.y.z -# - -set -e # Exit with error if any command fails - -# checkout repo with the current branch (not master!) - -git clone -b ${env_branch_name} https://github.com/NWChemEx-Project/PluginPlay.git -cd PluginPlay - -cmake_command=cmake -ctest_command=ctest -toolchain_file=$(pwd)/toolchain.cmake - -#pybind11_path=$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])') - -echo "set(BUILD_TESTING ON)" > "${toolchain_file}" -{ - echo "set(CMAKE_CXX_STANDARD 17)" - echo 'set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)' - echo "set(BUILD_SHARED_LIBS ON)" - echo "set(CATCH_ENABLE_COVERAGE ON)" - echo "set(CMAKE_PREFIX_PATH /install)" - #echo 'set(CMAKE_PREFIX_PATH "${pybind11_path};/install")' - echo 'set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -std=c++17")' - echo 'set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOMPI_SKIP_MPICXX")' - echo 'set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")' - echo 'set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs")' - echo 'set(CMAIZE_GITHUB_TOKEN '${env_cmaize_github_token}')' - echo 'set(CMAKE_BUILD_TYPE Release)' - echo 'set(ENABLE_SCALAPACK ON)' - echo 'set(LIBDIR "/usr/lib/x86_64-linux-gnu")' - echo 'set(BLAS_LIBRARIES "-L${LIBDIR} -lopenblas")' - echo 'set(LAPACK_LIBRARIES "-L${LIBDIR} -llapack ${BLAS_LIBRARIES}")' - echo 'set(ScaLAPACK_LIBRARIES "-L${LIBDIR} -lscalapack-openmpi ${LAPACK_LIBRARIES}")' - echo 'set(NWX_MODULE_DIRECTORY "./NWX_PyModules")' -} >> "${toolchain_file}" - -# if clang_build is true set clang and -# clang++ as default c and cxx compiler -# otherwise set gcc as default -# clang and gcc version controlled by defaults -# or inputs -if [ "${env_use_clang}" = true ] -then - { - echo "set(CMAKE_C_COMPILER /usr/bin/clang-${env_clang_version})" - echo "set(CMAKE_CXX_COMPILER /usr/bin/clang++-${env_clang_version})" - echo 'set(gpu_backend "none" CACHE STRING "" FORCE)' - } >> "${toolchain_file}" -else - { - echo "set(CMAKE_C_COMPILER /usr/bin/gcc-${env_gcc_version})" - echo "set(CMAKE_CXX_COMPILER /usr/bin/g++-${env_gcc_version})" - } >> "${toolchain_file}" -fi - -#Step 2: Configure -if [ "${env_install}" = true ]; then - export INSTALL_PATH=/install - if [ "${env_ninja_build}" = true ] ; then - ${cmake_command} -GNinja -H. -Bbuild -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} - else - ${cmake_command} -H. -Bbuild -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} - fi -else - if [ "${env_ninja_build}" = true ] ; then - ${cmake_command} -GNinja -H. -Bbuild -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" - else - ${cmake_command} -H. -Bbuild -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" - fi -fi - -#Step 3: Compile -${cmake_command} --build build - -# Step 4: test - -# set up the envs for running mpiexec in a container -# otherwise tests would fail -export OMPI_ALLOW_RUN_AS_ROOT=1 -export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 - -cd build -# unit testing -if [ "${env_unit_test}" = true ]; then - echo "Running unit tests..." - ${ctest_command} -VV -R test_unit* -fi -# integration testing -if [ "${env_int_test}" = true ]; then - echo "Running integration tests..." - ${ctest_command} -VV -R test_integration* -fi -# test docs -echo "Running doc tests..." -${ctest_command} -VV -R *docs - -# python testing -#export PYTHONPATH=$PYTHONPATH:/install -#echo "PYTHONPATH = " $PYTHONPATH -#echo "Running python tests..." -#${ctest_command} -VV -R py -cd .. - -#Step 5: Install -if [ "${env_install}" = true ]; then - echo "Installing package..." - ${cmake_command} --build build --target install -fi - diff --git a/.github/actions/container-build_test_release/entrypoint.sh b/.github/actions/container-build_test_release/entrypoint.sh deleted file mode 100644 index ae10a8a31..000000000 --- a/.github/actions/container-build_test_release/entrypoint.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -l -# Copyright 2023 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -CR_PAT=$1 -USER=$2 -BASE_TAG=$3 -CMAKE_VERSION=$4 -GCC_VRESION=$5 -CLANG_VERSION=$6 -NINJA_BUILD=$7 -USE_CLANG=$8 -CMAIZE_GITHUB_TOKEN=$9 -INSTALL=${10} -TEST=${11} -INTEGRATION_TEST=${12} -BRANCH_NAME=${13} -DEP_REPO_TAG=${14} - -cd /docker-action - -echo $CR_PAT | docker login ghcr.io -u $USER --password-stdin - -docker build -t docker-action --build-arg base_tag=$BASE_TAG --build-arg gcc_version=$GCC_VRESION --build-arg clang_version=$CLANG_VERSION --build-arg ninja_build=$NINJA_BUILD --build-arg use_clang=$USE_CLANG --build-arg cmaize_github_token=$CMAIZE_GITHUB_TOKEN --build-arg install=$INSTALL --build-arg unit_test=$TEST --build-arg int_test=$INTEGRATION_TEST --build-arg branch_name=$BRANCH_NAME --build-arg dep_repo_tag=${DEP_REPO_TAG} . && docker run docker-action - -container_id="$(docker ps -a | grep 'docker-action')" -container_id="${container_id%% *}" -docker cp ${container_id}:/install ./install - -cat <> release.Dockerfile -FROM scratch -ADD install /install -EOF - -if [ "${USE_CLANG}" = true ]; then - docker build -t ghcr.io/nwchemex-project/release_pluginplay:clang-latest -f release.Dockerfile . - docker push ghcr.io/nwchemex-project/release_pluginplay:clang-latest -else - docker build -t ghcr.io/nwchemex-project/release_pluginplay:gcc-latest -f release.Dockerfile . - docker push ghcr.io/nwchemex-project/release_pluginplay:gcc-latest -fi diff --git a/.github/actions/container-build_test_release/Dockerfile b/.github/actions/generate_module_docs/action.yaml similarity index 62% rename from .github/actions/container-build_test_release/Dockerfile rename to .github/actions/generate_module_docs/action.yaml index eec40bc1c..c3d234dd8 100644 --- a/.github/actions/container-build_test_release/Dockerfile +++ b/.github/actions/generate_module_docs/action.yaml @@ -11,14 +11,21 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# -FROM alpine:latest - -COPY docker-action /docker-action -COPY entrypoint.sh /entrypoint.sh +name: Generate Module Docs -RUN apk add --update --no-cache docker -RUN ["chmod", "+x", "/entrypoint.sh"] +inputs: + doc_target: + description: "The name of the documentation target." + type: string + required: false + default: '' -# Code file to execute when the docker container starts up (`entrypoint.sh`) -ENTRYPOINT ["/entrypoint.sh"] +runs: + using: "composite" + steps: + - name: Generate Module Documentation + run: | + python3 ${{github.action_path}}/generate_module_dox.py ${{inputs.target}} + shell: bash diff --git a/.github/actions/generate_module_docs/generate_module_dox.py b/.github/actions/generate_module_docs/generate_module_dox.py new file mode 100644 index 000000000..b87a44762 --- /dev/null +++ b/.github/actions/generate_module_docs/generate_module_dox.py @@ -0,0 +1,50 @@ +import os +import sys +import importlib + +"""This script will generate the module api documentation for a plugin library. + +Usage +----- + +:: + + usage: generate_module_dox.py library_name + + positional arguments: + library_name The name of the library for which the documentation is + supposed to be generated. + +This script checks that only one library name is passed and that it can import +pluginplay and the library specified. If the library is a plugin, a module +manager is constructed and the modules of the library are loaded into it. +The document_modules function is called on the manager. +""" + +if __name__ == "__main__": + # Exit if more than a single argument is passed + if len(sys.argv) != 2: + sys.exit() + target = sys.argv[1].replace("_cxx_api", "") + + # Add paths to libraries + cwd = os.getcwd() + build_dir = os.path.join(cwd, "build") + pluginplay_dir = os.path.join(cwd, "build", "_deps", "pluginplay-build") + sys.path.append(build_dir) + sys.path.append(pluginplay_dir) + + # Exit on any exception + try: + pluginplay = importlib.import_module("pluginplay") + library = importlib.import_module(target) + # If this library is a plugin, try to print the dox. + if hasattr(library, "load_modules"): + mm = pluginplay.ModuleManager() + library.load_modules(mm) + # This is no-op if docs/source/module_api doesn't exist + pluginplay.document_modules(mm, "docs/source/module_api") + except Exception as e: + print(f"An exception caught: {e}") + sys.exit() + diff --git a/.github/workflows/build_base.yaml b/.github/workflows/build_base.yaml deleted file mode 100644 index 1b6c86829..000000000 --- a/.github/workflows/build_base.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# manually input version no.s here -# will check in workflows to obtain -# this info from other files -# - -name: Build base image - -on: - workflow_call: - inputs: - cmake_version: - type: string - required: false - default: 3.17.0 - gcc_version: - type: string - required: false - default: 9 - clang_version: - type: string - required: false - default: 11 - ubuntu_version: - type: string - required: false - default: 20.04 - catch2_version: - type: string - required: false - default: 2.13.8 - libfort_version: - type: string - required: false - default: 0.4.2 - libboost_version: - type: string - required: false - default: 1.71.0 - -jobs: - build-image-gcc-clang-cmake: - uses: NWChemEx-Project/.github/.github/workflows/base_image_gcc-clang-cmake.yaml@master - with: - cmake_version: ${{ inputs.cmake_version }} - gcc_version: ${{ inputs.gcc_version }} - clang_version: ${{ inputs.clang_version }} - ubuntu_version: ${{ inputs.ubuntu_version }} - secrets: inherit - - build-base-image: - runs-on: ubuntu-latest - needs: build-image-gcc-clang-cmake - steps: - - uses: actions/checkout@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.CONTAINER_REPO_TOKEN }} - - name: Install libboost - uses: NWChemEx-Project/.github/actions/image-install_package@master - with: - libboost_version: ${{ inputs.libboost_version }} - package_name: libboost - parent_image_name: ghcr.io/nwchemex-project/base-cmake - path_to_dockerfile: .github/Dockerfile/base-libboost.Dockerfile - - name: Install libfort - uses: NWChemEx-Project/.github/actions/image-install_package@master - with: - libfort_version: ${{ inputs.libfort_version }} - package_name: libfort - parent_image_name: base-libboost - path_to_dockerfile: .github/Dockerfile/base-libfort.Dockerfile - - name: Install catch2 - uses: NWChemEx-Project/.github/actions/image-install_package@master - with: - catch2_version: ${{ inputs.catch2_version }} - package_name: catch2 - parent_image_name: base-libfort - path_to_dockerfile: .github/Dockerfile/base-catch2.Dockerfile - - name: Push the base image - uses: NWChemEx-Project/.github/actions/push_image@master - with: - tmp_image_name: base-catch2 - tmp_image_tag: latest - image_name: ghcr.io/nwchemex-project/base_pluginplay - image_tag: latest - - name: Check stable base image - id: image_exists - shell: /usr/bin/bash {0} - run: | - docker manifest inspect ghcr.io/nwchemex-project/base_pluginplay:stable > /dev/null - echo "conclusion=$?" >> "$GITHUB_OUTPUT" - - name: Push stable base image if not exist - if: ${{ steps.image_exists.outputs.conclusion != 0 }} - run: | - docker pull ghcr.io/nwchemex-project/base_pluginplay:latest - docker tag ghcr.io/nwchemex-project/base_pluginplay:latest ghcr.io/nwchemex-project/base_pluginplay:stable - docker push ghcr.io/nwchemex-project/base_pluginplay:stable diff --git a/.github/workflows/build_test_release-manual.yaml b/.github/workflows/build_test_release-manual.yaml deleted file mode 100644 index 486c7f96a..000000000 --- a/.github/workflows/build_test_release-manual.yaml +++ /dev/null @@ -1,98 +0,0 @@ -# The building/testing/releasing process happens -# in a container created from the base image (container action). -# In the end two new release images -# ghcr.io/nwchemex-project/release_pluginplay:gcc(clang)-latest -# are generated. Whether these images are stable -# (do not break any downstream repos) or not is still -# to be tested. -# This workflow should run in the branch which opens a -# PR to dev (dev/master model to be developed). - -name: Build test release - -on: - workflow_dispatch: - -jobs: - # TODO: obtain package version info - # general packages for all repos: from NWXCmake - # specific packages for a repo: from dependency_versions.txt in - # the repo - # - # A job to retrieve all package versions and output - ### - update-base-image: - uses: NWChemEx-Project/PluginPlay/.github/workflows/build_base.yaml@master - secrets: inherit - - build_test_release-gcc: - runs-on: ubuntu-latest - needs: update-base-image - steps: - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.CONTAINER_REPO_TOKEN }} - - uses: actions/checkout@v3 - - name: Get current branch name - id: branch-name - uses: tj-actions/branch-names@v7 - - name: build test release in a container - uses: ./.github/actions/container-build_test_release - with: - ninja_build: true - test: true - integration_test: false - INSTALL: true - base_tag: latest - dep_repo_tag: gcc-stable - token: ${{ secrets.CONTAINER_REPO_TOKEN }} - user: ${{ github.actor }} - cmake_version: 3.17.0 - gcc_version: 9 - use_clang: false - CMAIZE_GITHUB_TOKEN: ${{ secrets.CMAIZE_GITHUB_TOKEN }} - branch_name: ${{ steps.branch-name.outputs.current_branch }} - - name: Push stable release image if not exist - run: | - docker pull ghcr.io/nwchemex-project/release_pluginplay:gcc-latest - docker tag ghcr.io/nwchemex-project/release_pluginplay:gcc-latest ghcr.io/nwchemex-project/release_pluginplay:gcc-stable - docker push ghcr.io/nwchemex-project/release_pluginplay:gcc-stable - - build_test_release-clang: - runs-on: ubuntu-latest - needs: update-base-image - steps: - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.CONTAINER_REPO_TOKEN }} - - uses: actions/checkout@v3 - - name: Get current branch name - id: branch-name - uses: tj-actions/branch-names@v7 - - name: build test release in a container - uses: ./.github/actions/container-build_test_release - with: - ninja_build: true - test: true - integration_test: false - INSTALL: true - base_tag: latest - dep_repo_tag: clang-stable - token: ${{ secrets.CONTAINER_REPO_TOKEN }} - user: ${{ github.actor }} - cmake_version: 3.17.0 - clang_version: 11 - use_clang: true - CMAIZE_GITHUB_TOKEN: ${{ secrets.CMAIZE_GITHUB_TOKEN }} - branch_name: ${{ steps.branch-name.outputs.current_branch }} - - name: Push stable release image if not exist - run: | - docker pull ghcr.io/nwchemex-project/release_pluginplay:clang-latest - docker tag ghcr.io/nwchemex-project/release_pluginplay:clang-latest ghcr.io/nwchemex-project/release_pluginplay:clang-stable - docker push ghcr.io/nwchemex-project/release_pluginplay:clang-stable diff --git a/.github/workflows/build_test_release.yaml b/.github/workflows/build_test_release.yaml deleted file mode 100644 index b9e42d2a1..000000000 --- a/.github/workflows/build_test_release.yaml +++ /dev/null @@ -1,147 +0,0 @@ -# The building/testing/releasing process happens -# in a container created from the base image (container action). -# In the end two new release images -# ghcr.io/nwchemex-project/release_pluginplay:gcc(clang)-latest -# are generated. Whether these images are stable -# (do not break any downstream repos) or not is still -# to be tested. -# This workflow should run in the branch which opens a -# PR to dev (dev/master model to be developed). - -name: Build test release - -on: - pull_request: - branches: - - master - -jobs: - # TODO: obtain package version info - # general packages for all repos: from NWXCmake - # specific packages for a repo: from dependency_versions.txt in - # the repo - # - # A job to retrieve all package versions and output - ### - docker-file-changes: - runs-on: ubuntu-latest - outputs: - build_dockfile: ${{ steps.changes.outputs.bdfile }} - steps: - - uses: actions/checkout@v3 - - uses: dorny/paths-filter@v2 - id: changes - with: - filters: | - bdfile: - - '.github/Dockerfile/**' - - update-base-image: - needs: docker-file-changes - if: ${{ needs.docker-file-changes.outputs.build_dockfile == 'true' }} - uses: NWChemEx-Project/PluginPlay/.github/workflows/build_base.yaml@master - secrets: inherit - - build_update_check: - runs-on: ubuntu-latest - needs: docker-file-changes - outputs: - bi_check: ${{ steps.building-image-update.outputs.tag }} - steps: - - name: Check if the building image has been updated - id: building-image-update - run: | - if [ ${{ needs.docker-file-changes.outputs.build_dockfile == 'true' }} ]; then - tag="latest" - else - tag="stable" - fi - echo "tag=$tag" >> $GITHUB_OUTPUT - - build_test_release-gcc: - runs-on: ubuntu-latest - needs: [update-base-image, build_update_check] - if: always() && (needs.update-base-image.result == 'success' || needs.update-base-image.result == 'skipped') - steps: - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.CONTAINER_REPO_TOKEN }} - - uses: actions/checkout@v3 - - name: Get current branch name - id: branch-name - uses: tj-actions/branch-names@v7 - - name: build test release in a container - uses: ./.github/actions/container-build_test_release - with: - ninja_build: true - test: true - integration_test: false - INSTALL: true - base_tag: ${{needs.build_update_check.outputs.bi_check}} - dep_repo_tag: gcc-stable - token: ${{ secrets.CONTAINER_REPO_TOKEN }} - user: ${{ github.actor }} - cmake_version: 3.17.0 - gcc_version: 9 - use_clang: false - CMAIZE_GITHUB_TOKEN: ${{ secrets.CMAIZE_GITHUB_TOKEN }} - branch_name: ${{ steps.branch-name.outputs.current_branch }} - - name: Check stable release image - id: image_exists - shell: /usr/bin/bash {0} - run: | - docker manifest inspect ghcr.io/nwchemex-project/release_pluginplay:gcc-stable > /dev/null - echo "conclusion=$?" >> "$GITHUB_OUTPUT" - - name: Push stable release image if not exist - if: ${{ steps.image_exists.outputs.conclusion != 0 }} - run: | - docker pull ghcr.io/nwchemex-project/release_pluginplay:gcc-latest - docker tag ghcr.io/nwchemex-project/release_pluginplay:gcc-latest ghcr.io/nwchemex-project/release_pluginplay:gcc-stable - docker push ghcr.io/nwchemex-project/release_pluginplay:gcc-stable - - build_test_release-clang: - runs-on: ubuntu-latest - needs: [update-base-image, build_update_check] - if: always() && (needs.update-base-image.result == 'success' || needs.update-base-image.result == 'skipped') - steps: - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.CONTAINER_REPO_TOKEN }} - - uses: actions/checkout@v3 - - name: Get current branch name - id: branch-name - uses: tj-actions/branch-names@v7 - - name: build test release in a container - uses: ./.github/actions/container-build_test_release - with: - ninja_build: true - test: true - integration_test: false - INSTALL: true - base_tag: ${{needs.build_update_check.outputs.bi_check}} - dep_repo_tag: clang-stable - token: ${{ secrets.CONTAINER_REPO_TOKEN }} - user: ${{ github.actor }} - cmake_version: 3.17.0 - clang_version: 11 - use_clang: true - CMAIZE_GITHUB_TOKEN: ${{ secrets.CMAIZE_GITHUB_TOKEN }} - branch_name: ${{ steps.branch-name.outputs.current_branch }} - - name: Check stable release image - id: image_exists - shell: /usr/bin/bash {0} - run: | - docker manifest inspect ghcr.io/nwchemex-project/release_pluginplay:clang-stable > /dev/null - echo "conclusion=$?" >> "$GITHUB_OUTPUT" - - name: Push stable release image if not exist - if: ${{ steps.image_exists.outputs.conclusion != 0 }} - run: | - docker pull ghcr.io/nwchemex-project/release_pluginplay:clang-latest - docker tag ghcr.io/nwchemex-project/release_pluginplay:clang-latest ghcr.io/nwchemex-project/release_pluginplay:clang-stable - docker push ghcr.io/nwchemex-project/release_pluginplay:clang-stable