From 5795aa00523a9c633b7ab937e8bf5302350245e4 Mon Sep 17 00:00:00 2001 From: Chris Hansen Date: Tue, 5 Mar 2024 16:36:03 -0500 Subject: [PATCH] Add continuous delivery builds for commits to main - Update naming of GitHub actions workflows --- .github/workflows/cd_nightly.yaml | 102 ++++++++++++++++++++++++++++++ .github/workflows/ci_build.yaml | 2 +- .github/workflows/cov_build.yaml | 2 +- .github/workflows/website.yaml | 2 +- 4 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/cd_nightly.yaml diff --git a/.github/workflows/cd_nightly.yaml b/.github/workflows/cd_nightly.yaml new file mode 100644 index 0000000..692a6d2 --- /dev/null +++ b/.github/workflows/cd_nightly.yaml @@ -0,0 +1,102 @@ +name: CD Build + +on: + push: + branches: + - main + +jobs: + build: + name: ${{ format('Nightly ({0})', matrix.config.name) }} + runs-on: ${{ matrix.config.os }} + env: + CC: ${{ matrix.config.cc }} + CXX: ${{ matrix.config.cxx }} + FC: ${{ matrix.config.fc }} + + strategy: + fail-fast: false + matrix: + config: + - { + name: "Linux x86_64", + os: ubuntu-20.04, + cc: "gcc-10", cxx: "g++-10", fc: "gfortran-10", python: "python", pip: "pip" + } + - { + name: "macOS x86_64", + os: macos-12, + cc: "gcc-12", cxx: "g++-12", fc: "gfortran-12", python: "python3", pip: "pip3" + } + - { + name: "macOS arm64", + os: macos-14, + cc: "gcc-13", cxx: "g++-13", fc: "gfortran-13", python: "python3", pip: "pip3" + } + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Cache external libraries + id: cache-ext-libs + uses: actions/cache@v4 + with: + path: libs + key: ${{ matrix.config.os }}-nightly-${{ hashFiles('src/utilities/build_libs.py') }} + + - name: Create build dir + if: ${{ steps.cache-ext-libs.outputs.cache-hit != 'true' }} + run: mkdir libs + + - name: Check compilers + run: | + $CC --version + $CXX --version + $FC --version + + - name: Build external + shell: bash + working-directory: libs + run: > + ${{ matrix.config.python }} ../src/utilities/build_libs.py --no_dl_progress --nthread=2 --ref_blas + --build_umfpack=1 --build_arpack=1 --oft_package + + - name: Upload library failure log + uses: actions/upload-artifact@v4 + if: failure() + with: + name: Library failure log + path: libs/build/build_error.log + + - name: Remove external build directory + shell: bash + working-directory: libs + run: rm -rf build + + - name: Configure OFT + shell: bash + working-directory: libs + run: bash config_cmake.sh + + - name: Build OFT + shell: bash + working-directory: libs/build_release + run: make + + - name: Install OFT + shell: bash + working-directory: libs/build_release + run: make install + + - name: Package OFT + shell: bash + working-directory: libs/build_release + run: make package + + - name: Upload package artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.config.name }}-${{ github.sha }} + path: libs/build_release/OpenFUSIONToolkit_* + overwrite: true diff --git a/.github/workflows/ci_build.yaml b/.github/workflows/ci_build.yaml index cac3b02..d7379b8 100644 --- a/.github/workflows/ci_build.yaml +++ b/.github/workflows/ci_build.yaml @@ -1,4 +1,4 @@ -name: Open FUSION Toolkit CI build +name: CI Build on: push: diff --git a/.github/workflows/cov_build.yaml b/.github/workflows/cov_build.yaml index 1dfec9b..eb3b928 100644 --- a/.github/workflows/cov_build.yaml +++ b/.github/workflows/cov_build.yaml @@ -1,4 +1,4 @@ -name: Open FUSION Toolkit code coverage build +name: Coverage Build on: push: diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index d195098..a6e7a1e 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -1,5 +1,5 @@ # Based on sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Build and deploy OFT website using GitHub Pages +name: GitHub Pages Build on: # Runs on pushes targeting main or gh-pages branch (deploy on gh-pages only)