|
| 1 | +name: IFPEN ubu2204 foss/2018b |
| 2 | + |
| 3 | +on: |
| 4 | + #push: |
| 5 | + # branches: [ main, dev/cea, dev/ifpen, dev/ci_ifpen ] |
| 6 | + #pull_request: |
| 7 | + # branches: [ main, dev/cea, dev/ifpen, dev/ci_ifpen ] |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + ctest_options: |
| 11 | + description: 'CTest options' |
| 12 | + required: false |
| 13 | + default: '' |
| 14 | + |
| 15 | +env: |
| 16 | + # Framework directories |
| 17 | + BUILD_DIR: /__w/framework/framework/build |
| 18 | + INSTALL_DIR: /__w/framework/framework/install |
| 19 | + SOURCE_DIR: /__w/framework/framework/source |
| 20 | + EXT_LIB_SUBDIR: extlib # /__w/framework/framework/build/dependencies |
| 21 | + # ccache |
| 22 | + CCACHE_COMPRESS: true |
| 23 | + CCACHE_COMPRESSLEVEL: 6 |
| 24 | + CCACHE_DIR: '/__w/framework/framework/ccache' |
| 25 | + CCACHE_MAXSIZE: 5G |
| 26 | + # CMake |
| 27 | + CM_BUILD_OPTS: "-j4" |
| 28 | + CM_BUILD_TYPE: Release |
| 29 | + CM_CCACHE_OPTS: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache" |
| 30 | + # CTest |
| 31 | + CT_OPTS: "--timeout 300 --output-on-failure ${{ github.event.inputs.ctest_options }}" |
| 32 | + # OpenMPI |
| 33 | + OMPI_MCA_rmaps_base_oversubscribe : true |
| 34 | + # To remove test output directory to reduce disk usage |
| 35 | + ARCANE_TEST_CLEANUP_AFTER_RUN : 1 |
| 36 | + |
| 37 | +jobs: |
| 38 | + |
| 39 | + build: |
| 40 | + name: build |
| 41 | + runs-on: ubuntu-latest |
| 42 | + timeout-minutes: 120 |
| 43 | + container: |
| 44 | + image: ghcr.io/arcaneframework/arcane-ifpen-devenv-foss-2018b:ubu2204 |
| 45 | + #options: --user root # Avoid to match github UID in container. |
| 46 | + strategy: |
| 47 | + fail-fast: false |
| 48 | + |
| 49 | + steps: |
| 50 | + |
| 51 | + # ccache |
| 52 | + |
| 53 | + - name: Get date |
| 54 | + id: get-date |
| 55 | + shell: bash |
| 56 | + run: echo "NOW=$(/bin/date -u '+%Y%m%d%H%M%S')" >> $GITHUB_ENV |
| 57 | + |
| 58 | + - name: Restore cache |
| 59 | + id: restore-cache |
| 60 | + uses: actions/cache/restore@v4 |
| 61 | + with: |
| 62 | + path: ${{ env.CCACHE_DIR }} |
| 63 | + key: ifpen-ubu2204-foss-2018b-${{ env.CM_BUILD_TYPE }}-${{ env.NOW }}-${{ github.run_number }} |
| 64 | + restore-keys: ifpen-ubu2204-foss-2018b-${{ env.CM_BUILD_TYPE }}- |
| 65 | + |
| 66 | + # Installation |
| 67 | + |
| 68 | + - name: Checkout |
| 69 | + id: checkout |
| 70 | + if: | |
| 71 | + (success() || failure()) |
| 72 | + uses: actions/checkout@v4 |
| 73 | + with: |
| 74 | + path: ${{ env.SOURCE_DIR }} |
| 75 | + submodules: true |
| 76 | + |
| 77 | + - name: Modules information |
| 78 | + id: modules_information |
| 79 | + if: | |
| 80 | + (success() || failure()) && |
| 81 | + steps.checkout.outcome == 'success' |
| 82 | + shell: bash |
| 83 | + run: module --terse list 2>&1 | sort |
| 84 | + |
| 85 | + - name: Configure |
| 86 | + id: configure |
| 87 | + if: | |
| 88 | + (success() || failure()) && |
| 89 | + steps.checkout.outcome == 'success' |
| 90 | + shell: bash |
| 91 | + run: cmake -S ${{ env.SOURCE_DIR }} -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} ${{ env.CM_CCACHE_OPTS }} -DCMAKE_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 -DALIEN_PLUGIN_HYPRE=ON -DALIEN_PLUGIN_PETSC=ON -DUSE_GRAPH_CONNECTIVITY_POLICY=ON |
| 92 | + |
| 93 | + - name: Build |
| 94 | + id: build |
| 95 | + if: | |
| 96 | + (success() || failure()) && |
| 97 | + steps.configure.outcome == 'success' |
| 98 | + shell: bash |
| 99 | + run: cmake --build ${{ env.BUILD_DIR }} ${{ env.CM_BUILD_OPTS }} |
| 100 | + |
| 101 | + - name: Clean |
| 102 | + id: clean |
| 103 | + if: | |
| 104 | + (success() || failure()) && |
| 105 | + steps.build.outcome == 'success' |
| 106 | + shell: bash |
| 107 | + run: find ${{ env.BUILD_DIR }} -type f -name '*.o' -exec rm -f '{}' \; |
| 108 | + |
| 109 | + - name: Install |
| 110 | + id: install |
| 111 | + if: | |
| 112 | + (success() || failure()) && |
| 113 | + steps.build.outcome == 'success' |
| 114 | + shell: bash |
| 115 | + run: cmake --install ${{ env.BUILD_DIR }} |
| 116 | + |
| 117 | + - name: Copy external libraries |
| 118 | + id: copy-external-libraries |
| 119 | + if: | |
| 120 | + (success() || failure()) && |
| 121 | + steps.install.outcome == 'success' |
| 122 | + shell: bash |
| 123 | + run: | |
| 124 | + cd ${{ env.BUILD_DIR }} |
| 125 | + echo '--' |
| 126 | + cat /scripts/copyextlib_github.sh |
| 127 | + echo '--' |
| 128 | + bash /scripts/copyextlib_github.sh |
| 129 | +
|
| 130 | + - name: Tar build artifact |
| 131 | + shell: bash |
| 132 | + run: tar czf build-artifact.tar.gz ${{ env.BUILD_DIR }} |
| 133 | + |
| 134 | + - name: Upload build artifact |
| 135 | + uses: actions/upload-artifact@v4 |
| 136 | + with: |
| 137 | + name: build-artifact |
| 138 | + path: build-artifact.tar.gz |
| 139 | + retention-days: 1 |
| 140 | + |
| 141 | + - name: Save cache |
| 142 | + id: save-cache |
| 143 | + if: | |
| 144 | + (success() || failure()) && |
| 145 | + steps.build.outcome == 'success' |
| 146 | + uses: actions/cache/save@v4 |
| 147 | + with: |
| 148 | + path: ${{ env.CCACHE_DIR }} |
| 149 | + key: ${{ steps.restore-cache.outputs.cache-primary-key }} |
| 150 | + |
| 151 | + test: |
| 152 | + name: test |
| 153 | + needs: |
| 154 | + - build |
| 155 | + runs-on: ubuntu-latest |
| 156 | + timeout-minutes: 120 |
| 157 | + container: |
| 158 | + image: ghcr.io/arcaneframework/arcane-ifpen-devenv-foss-2018b-rt:ubu2204 |
| 159 | + #options: --user root # Avoid to match github UID in container. |
| 160 | + strategy: |
| 161 | + fail-fast: false |
| 162 | + |
| 163 | + steps: |
| 164 | + |
| 165 | + - name: Checkout |
| 166 | + id: checkout |
| 167 | + if: | |
| 168 | + (success() || failure()) |
| 169 | + uses: actions/checkout@v4 |
| 170 | + with: |
| 171 | + path: ${{ env.SOURCE_DIR }} |
| 172 | + submodules: true |
| 173 | + |
| 174 | + - name: Download build artifact |
| 175 | + uses: actions/download-artifact@v4 |
| 176 | + with: |
| 177 | + name: build-artifact |
| 178 | + |
| 179 | + - name: Untar build artifact |
| 180 | + shell: bash |
| 181 | + run: tar xf build-artifact.tar.gz -C / |
| 182 | + |
| 183 | + - name: Remove build artifact tar |
| 184 | + shell: bash |
| 185 | + run: rm -f build-artifact.tar.gz |
| 186 | + |
| 187 | + - name: Test |
| 188 | + id: test |
| 189 | + shell: bash |
| 190 | + run: env LD_LIBRARY_PATH=${{ env.BUILD_DIR }}/${{ env.EXT_LIB_SUBDIR }}:${LD_LIBRARY_PATH} ctest --test-dir ${{ env.BUILD_DIR }} ${{ env.CT_OPTS }} |
| 191 | + |
| 192 | + - name: Upload test artifact |
| 193 | + id: upload-test-artifact |
| 194 | + uses: actions/upload-artifact@v4 |
| 195 | + if: | |
| 196 | + (success() || failure()) && |
| 197 | + steps.test.outcome == 'failure' |
| 198 | + with: |
| 199 | + name: test-artifact |
| 200 | + path: ${{ env.BUILD_DIR }}/Testing |
| 201 | + retention-days: 1 |
0 commit comments