Skip to content

IFPEN el8 foss/2018b #11

IFPEN el8 foss/2018b

IFPEN el8 foss/2018b #11

name: IFPEN el8 foss/2018b
on:
#push:
# branches: [ main, dev/cea, dev/ifpen, dev/ci_ifpen ]
#pull_request:
# branches: [ main, dev/cea, dev/ifpen, dev/ci_ifpen ]
workflow_dispatch:
env:
# Framework directories
BUILD_DIR: /__w/framework/framework/build
INSTALL_DIR: /__w/framework/framework/install
SOURCE_DIR: /__w/framework/framework/source
EXT_LIB_SUBDIR: extlib # /__w/framework/framework/build/dependencies
# ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_DIR: '/__w/framework/framework/ccache'
CCACHE_MAXSIZE: 5G
# CMake
CM_BUILD_OPTS: "-j2"
CM_BUILD_TYPE: Release
CM_CCACHE_OPTS: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
# CTest
CT_OPTS: "--timeout 300 --output-on-failure"
# For intel MPI to fix errors appearing in July 2023
I_MPI_SHM_LMT: shm
jobs:
build:
name: build
runs-on: ubuntu-latest
timeout-minutes: 120
container:
image: ghcr.io/arcaneframework/arcane-ifpen-devenv-foss-2018b:el8
#options: --user root # Avoid to match github UID in container.
strategy:
fail-fast: false
steps:
# ccache
- name: Get date
id: get-date
shell: bash
run: echo "NOW=$(/bin/date -u '+%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Restore cache
id: restore-cache
uses: actions/cache/restore@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ifpen-el8-foss-2018b-${{ env.CM_BUILD_TYPE }}-${{ env.NOW }}-${{ github.run_number }}
restore-keys: ifpen-el8-foss-2018b-${{ env.CM_BUILD_TYPE }}-
# Installation
- name: Checkout
id: checkout
if: |
(success() || failure())
uses: actions/checkout@v3
with:
path: ${{ env.SOURCE_DIR }}
submodules: true
- name: Configure
id: configure
if: |
(success() || failure()) &&
steps.checkout.outcome == 'success'
shell: bash
run: cmake -S ${{ env.SOURCE_DIR }} -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} ${{ env.CM_CCACHE_OPTS }} -DARCANE_WANT_CHECK=ON -DARCANE_BUILD_TYPE=${{ env.CM_BUILD_TYPE }} -DARCCORE_BUILD_MODE=Check -DREMOVE_UID_ON_DETACH=ON -DUSE_GTEST_DEATH_TEST=ON -DCMAKE_DISABLE_FIND_PACKAGE_Papi=ON -DALIEN_BUILD_COMPONENT=all
- name: Build
id: build
if: |
(success() || failure()) &&
steps.configure.outcome == 'success'
shell: bash
run: cmake --build ${{ env.BUILD_DIR }} ${{ env.CM_BUILD_OPTS }}
- name: Clean
id: clean
if: |
(success() || failure()) &&
steps.build.outcome == 'success'
shell: bash
run: find ${{ env.BUILD_DIR }} -type f -name '*.o' -exec rm -f '{}' \;
- name: Install
id: install
if: |
(success() || failure()) &&
steps.build.outcome == 'success'
shell: bash
run: cmake --install ${{ env.BUILD_DIR }}
- name: Copy external libraries
id: copy-external-libraries
if: |
(success() || failure()) &&
steps.install.outcome == 'success'
shell: bash
run: |
osdir=centos_`lsb_release -r | awk -F ":" '{print $2}' | awk -F "." '{print $1}' | tr -d '\t'`
mkdir -p ${{ env.BUILD_DIR }}/${{ env.EXT_LIB_SUBDIR }}
export LD_LIBRARY_PATH="${{ env.INSTALL_DIR }}/lib:${LD_LIBRARY_PATH}"
# Copy libraries
while read line; do \cp -avn ${line} ${{ env.BUILD_DIR }}/${{ env.EXT_LIB_SUBDIR }}/.; if [ -L ${line} ]; then \cp -avn `readlink -f ${line}` ${{ env.BUILD_DIR }}/${{ env.EXT_LIB_SUBDIR }}/.; fi; done < <(ldd ${{ env.INSTALL_DIR }}/bin/alien* ${{ env.INSTALL_DIR }}/bin/gtest* ${{ env.INSTALL_DIR }}/lib/*.so ${{ env.INSTALL_DIR }}/lib/arcane_driver | awk 'NF == 4 { print $3 }' | grep -v -e "^/lib64/" -e "^${EBROOTOPENMPI}" -e "^${EBROOTUDUNITS}" -e "^${EBROOTMONO}" -e "^${EBROOTCMAKE}" -e "^${EBROOTDOTNETMINSDK}" -e "^/__w/")
# Copy googletest
\rm -vf ${{ env.BUILD_DIR }}/${{ env.EXT_LIB_SUBDIR }}//libgtest.so
\cp -avf /soft/irsrvsoft1/expl/eb/r11/${osdir}/easybuild/software/Compiler/GCCcore/7.3.0/googletest/1.10.0/lib64/*.so ${{ env.BUILD_DIR }}/${{ env.EXT_LIB_SUBDIR }}/.
- name: Tar build artifact
shell: bash
run: tar czf build-artifact.tar.gz ${{ env.BUILD_DIR }}
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: build-artifact
path: build-artifact.tar.gz
retention-days: 1
- name: Save cache
id: save-cache
if: |
(success() || failure()) &&
steps.build.outcome == 'success'
uses: actions/cache/save@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
test:
name: test
needs:
- build
runs-on: ubuntu-latest
timeout-minutes: 120
container:
image: ghcr.io/arcaneframework/arcane-ifpen-devenv-foss-2018b:el8-rt
#options: --user root # Avoid to match github UID in container.
strategy:
fail-fast: false
steps:
- name: Checkout
id: checkout
if: |
(success() || failure())
uses: actions/checkout@v3
with:
path: ${{ env.SOURCE_DIR }}
submodules: true
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: build-artifact
- name: Untar build artifact
shell: bash
run: tar xf build-artifact.tar.gz -C /
- name: Remove build artifact tar
shell: bash
run: rm -f build-artifact.tar.gz
- name: Test
id: test
shell: bash
run: env LD_LIBRARY_PATH=${{ env.BUILD_DIR }}/${{ env.EXT_LIB_SUBDIR }}:${LD_LIBRARY_PATH} ctest --test-dir ${{ env.BUILD_DIR }} ${{ env.CT_OPTS }}
- name: Upload test artifact
id: upload-test-artifact
uses: actions/upload-artifact@v3
if: |
(success() || failure()) &&
steps.test.outcome == 'failure'
with:
name: test-artifact
path: ${{ env.BUILD_DIR }}/Testing
retention-days: 1