Skip to content

Commit

Permalink
Merge pull request #7 from arcaneframework/dev/ah-dir-size
Browse files Browse the repository at this point in the history
Display size of directories
  • Loading branch information
AlexlHer authored Jul 20, 2024
2 parents 451ac1b + e0277ec commit b174699
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 8 deletions.
102 changes: 96 additions & 6 deletions .github/workflows/reusable_test_framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ on:
type: boolean
required: false
default: false
ccache_debug_mode:
description: 'Activate CCache debug mode'
type: boolean
required: false
default: false
with_samples:
description: 'Compile samples too ? Require install_dir.'
type: boolean
Expand Down Expand Up @@ -122,6 +127,16 @@ jobs:
echo "LOG_DIR=${GITHUB_WORKSPACE}/log" >> $GITHUB_ENV
echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
- name: Create paths
shell: bash
run: |
mkdir ${{ env.SOURCE_DIR }} \
${{ env.BUILD_DIR }} \
${{ env.INSTALL_DIR }} \
${{ env.CCACHE_DIR }} \
${{ env.LOG_DIR }} \
${{ env.CT_RESULT_DIR }}
- name: Set MPICH as default MPI
if: "${{ inputs.mpi == 'MPICH' }}"
shell: bash
Expand Down Expand Up @@ -176,15 +191,44 @@ jobs:
echo "$MRAND"
echo "M_RAND=$MRAND" >> $GITHUB_ENV
- name: Display disks infos and size of directories
shell: bash
run: |
df -h
dum(){
DIR="${1:-0}"
CMDD=$(du -ahc --time --max-depth=1 "${DIR}")
grep -E -- '$(echo "${CMDD}" | tail -n1)|$' <(echo "${CMDD}" | sort -h)
}
echo "::group::SOURCE_DIR :"
dum "${{ env.SOURCE_DIR }}"
echo "::endgroup::"
echo "::group::BUILD_DIR :"
dum "${{ env.BUILD_DIR }}"
echo "::endgroup::"
echo "::group::INSTALL_DIR :"
dum "${{ env.INSTALL_DIR }}"
echo "::endgroup::"
echo "::group::LOG_DIR :"
dum "${{ env.LOG_DIR }}"
echo "::endgroup::"
echo "::group::CCACHE_DIR :"
dum "${{ env.CCACHE_DIR }}"
echo "::endgroup::"
echo "::group::CT_RESULT_DIR :"
dum "${{ env.CT_RESULT_DIR }}"
echo "::endgroup::"
- name: Build and install framework
uses: arcaneframework/gh_actions/build_install_framework@v2.0.0
uses: arcaneframework/gh_actions/build_install_framework@v2.1.0
with:
source_dir: ${{ env.SOURCE_DIR }}
build_dir: ${{ env.BUILD_DIR }}
install_dir: ${{ env.INSTALL_DIR }}
log_dir: ${{ env.LOG_DIR }}
cache_dir: ${{ env.CCACHE_DIR }}
max_size_cache_dir: 1G
ccache_debug_mode: ${{ inputs.ccache_debug_mode }}
cmake_additionnal_args: '${{ env.CMAKE_ADD_ARGS }} ${{ inputs.cmake_additionnal_args }} ${{ env.M_RAND }}'
verbose: ${{ inputs.verbose }}
type_build: ${{ inputs.type_build }}
Expand All @@ -193,18 +237,41 @@ jobs:
with_acpp: ${{ inputs.use_acpp }}
with_samples: ${{ inputs.with_samples }}

- name: Upload failure artifact
if: failure()
- name: Upload log artifact
if: ${{ failure() || inputs.ccache_debug_mode == 'true' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.cache_key_prefix }}-failure_config_build-artifact
name: ${{ inputs.cache_key_prefix }}-log_config_build-artifact
path: ${{ env.LOG_DIR }}
retention-days: 7

- name: Display disks infos
- name: Display disks infos and size of directories
shell: bash
run: |
df -h
dum(){
DIR="${1:-0}"
CMDD=$(du -ahc --time --max-depth=1 "${DIR}")
grep -E -- '$(echo "${CMDD}" | tail -n1)|$' <(echo "${CMDD}" | sort -h)
}
echo "::group::SOURCE_DIR :"
dum "${{ env.SOURCE_DIR }}"
echo "::endgroup::"
echo "::group::BUILD_DIR :"
dum "${{ env.BUILD_DIR }}"
echo "::endgroup::"
echo "::group::INSTALL_DIR :"
dum "${{ env.INSTALL_DIR }}"
echo "::endgroup::"
echo "::group::LOG_DIR :"
dum "${{ env.LOG_DIR }}"
echo "::endgroup::"
echo "::group::CCACHE_DIR :"
dum "${{ env.CCACHE_DIR }}"
echo "::endgroup::"
echo "::group::CT_RESULT_DIR :"
dum "${{ env.CT_RESULT_DIR }}"
echo "::endgroup::"
- name: Test
if: ${{ inputs.execute_tests }}
Expand All @@ -213,10 +280,33 @@ jobs:
mkdir -p ${{ env.CT_RESULT_DIR }}
ARCANE_CHECK=1 ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml --output-on-failure -E '${{inputs.excluded_tests}}' -LE '${{inputs.excluded_tests_with_labels}}' ${{inputs.ctest_additionnal_args}}
- name: Display disks infos
- name: Display disks infos and size of directories
shell: bash
run: |
df -h
dum(){
DIR="${1:-0}"
CMDD=$(du -ahc --time --max-depth=1 "${DIR}")
grep -E -- '$(echo "${CMDD}" | tail -n1)|$' <(echo "${CMDD}" | sort -h)
}
echo "::group::SOURCE_DIR :"
dum "${{ env.SOURCE_DIR }}"
echo "::endgroup::"
echo "::group::BUILD_DIR :"
dum "${{ env.BUILD_DIR }}"
echo "::endgroup::"
echo "::group::INSTALL_DIR :"
dum "${{ env.INSTALL_DIR }}"
echo "::endgroup::"
echo "::group::LOG_DIR :"
dum "${{ env.LOG_DIR }}"
echo "::endgroup::"
echo "::group::CCACHE_DIR :"
dum "${{ env.CCACHE_DIR }}"
echo "::endgroup::"
echo "::group::CT_RESULT_DIR :"
dum "${{ env.CT_RESULT_DIR }}"
echo "::endgroup::"
- name: Upload test artifact
if: failure()
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This composite action can work with any docker image with the necessary/recommen
| `log_dir` | Log directory to save logs. You can use the `actions/upload-artifact` action to easily get the logs. If no value is given, the log will not be moved from the build folder. | No () |
| `cache_dir` | Cache directory to speed up compilation. You can use the `actions/cache` action to save/restore this folder for a future build. If it is empty, ccache will not be used. | No () |
| `max_size_cache_dir` | Max size for the `cache_dir` directory. | No (`5G`) |
| `ccache_debug_mode` | Activate CCache debug mode (need a `log_dir`). | No (`false`) |
| `cmake_additionnal_args` | Additional arguments given to CMake configure. Example: `'-DARCCORE_CXX_STANDARD=23 -DARCANE_DISABLE_PERFCOUNTER_TESTS=ON -DARCANE_DEFAULT_PARTITIONER=Metis'` | No () |
| `type_build` | Type of build. You can choose `Debug`, `Check` or `Release`. | No (`Release`) |
| `use_ninja` | Use ninja instead of make to build the Framework. | No (`true`) |
Expand Down Expand Up @@ -99,7 +100,7 @@ https://github.com/arcaneframework/framework/blob/main/.github/workflows/build_t
```yml
jobs:
build-install-test:
name: '[U22_G12_C16_M]_CLang_OpenMPI_Release'
name: '[U24_C18_M]_OMPI_Release'
uses: 'arcaneframework/gh_actions/.github/workflows/reusable_test_framework.yml@v2'
with:
image: ghcr.io/arcaneframework/ubuntu-2404:clang-18_minimal_20240717
Expand Down
7 changes: 6 additions & 1 deletion build_install_framework/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ inputs:
type: string
required: false
default: "5G"
ccache_debug_mode:
description: 'Activate CCache debug mode (need a log_dir)'
type: boolean
required: false
default: false
cmake_additionnal_args:
description: 'Additionnal arguments for configure'
type: string
Expand Down Expand Up @@ -178,7 +183,7 @@ runs:
echo "ACTION_CMAKE_ADD_ARGS=${{ env.ACTION_CMAKE_ADD_ARGS }} -DALIEN_GENERATE_DOCUMENTATION=ON" >> $GITHUB_ENV
- name: Set debug mode for ccache
if: "${{ inputs.log_dir != '' }}"
if: "${{ inputs.log_dir != '' && inputs.ccache_debug_mode == 'true' }}"
shell: bash
run: |
mkdir -p "${{ inputs.log_dir }}/ccache"
Expand Down

0 comments on commit b174699

Please sign in to comment.