build-test-analyze #279
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-test-analyze | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| schedule: | |
| - cron: '23 14 * * 3' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| buildTestAnalyze: | |
| # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
| # A known bug using MPICH ubuntu-24.04: https://bugs.launchpad.net/ubuntu/+source/mpich/+bug/2072338 | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| compiler: | |
| - { compiler: GNU, CC: gcc, CXX: g++ } | |
| - { compiler: LLVM, CC: clang, CXX: clang++ } | |
| language: ['cpp'] | |
| build_type: [Debug, Release] | |
| # Permissions needed for codeql analysis | |
| # I think this is the minimal set needed for a public repo (https://github.com/github/codeql-action/pull/689). | |
| permissions: | |
| security-events: write | |
| env: | |
| MPICH_CC: ${{matrix.compiler.CC}} | |
| MPICH_CXX: ${{matrix.compiler.CXX}} | |
| adios_version: v2.10.2 | |
| steps: | |
| - name: Install CMake | |
| run: | | |
| sudo apt-get update -yq | |
| sudo apt-get install -yq cmake | |
| cmake --version | |
| /usr/bin/cmake --version | |
| - name: Install mpi | |
| run: | | |
| sudo apt-get update -yq | |
| sudo apt-get install -yq openmpi-bin libopenmpi-dev | |
| - name: ADIOS2 Create Build Environment | |
| run: /usr/bin/cmake -E make_directory ${{runner.workspace}}/build-adios2 | |
| - name: Restore ADIOS2 | |
| id: restore-adios2 | |
| uses: actions/cache/restore@v3 | |
| with: | |
| path: ${{runner.workspace}}/build-adios2/install | |
| key: adios2-${{env.adios_version}}-${{ matrix.compiler.CC }} | |
| - name: ADIOS2 Checkout repo | |
| if: steps.restore-adios2.outputs.cache-hit != 'true' | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: ornladios/adios2 | |
| path: adios2 | |
| ref: ${{env.adios_version}} | |
| - name: ADIOS2 Configure CMake | |
| if: steps.restore-adios2.outputs.cache-hit != 'true' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build-adios2 | |
| run: /usr/bin/cmake $GITHUB_WORKSPACE/adios2 | |
| -DCMAKE_CXX_COMPILER=mpicxx | |
| -DCMAKE_C_COMPILER=mpicc | |
| -DADIOS2_USE_MPI=ON | |
| -DADIOS2_USE_CUDA=OFF | |
| -DADIOS2_BUILD_EXAMPLES=OFF | |
| -DBUILD_TESTING=OFF | |
| -DADIOS2_USE_Fortran=OFF | |
| -DADIOS2_USE_SST=ON | |
| -DADIOS2_INSTALL_GENERATE_CONFIG=OFF | |
| -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build-adios2/install | |
| - name: ADIOS2 Build | |
| if: steps.restore-adios2.outputs.cache-hit != 'true' | |
| working-directory: ${{runner.workspace}}/build-adios2 | |
| shell: bash | |
| run: | | |
| /usr/bin/cmake --build . --parallel 2 | |
| /usr/bin/cmake --install . | |
| - name: Save ADIOS2 | |
| id: save-adios2 | |
| uses: actions/cache/save@v3 | |
| with: | |
| path: ${{runner.workspace}}/build-adios2/install | |
| key: ${{ steps.restore-adios2.outputs.cache-primary-key }} | |
| - name: perfstubs Create Build Environment | |
| run: /usr/bin/cmake -E make_directory ${{runner.workspace}}/build-perfstubs | |
| - name: Restore perfstubs | |
| id: restore-perfstubs | |
| uses: actions/cache/restore@v3 | |
| with: | |
| path: ${{runner.workspace}}/build-perfstubs/install | |
| key: perfstubs-${{ matrix.compiler.CC }} | |
| - name: perfstubs Checkout repo | |
| if: steps.restore-perfstubs.outputs.cache-hit != 'true' | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: UO-OACISS/perfstubs | |
| path: perfstubs | |
| - name: perfstubs Configure CMake | |
| if: steps.restore-perfstubs.outputs.cache-hit != 'true' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build-perfstubs | |
| run: | | |
| /usr/bin/cmake $GITHUB_WORKSPACE/perfstubs \ | |
| -DCMAKE_CXX_COMPILER=mpicxx \ | |
| -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build-perfstubs/install | |
| - name: perfstubs Build | |
| if: steps.restore-perfstubs.outputs.cache-hit != 'true' | |
| working-directory: ${{runner.workspace}}/build-perfstubs | |
| shell: bash | |
| run: | | |
| /usr/bin/cmake --build . --parallel 2 | |
| /usr/bin/cmake --install . | |
| - name: Save perfstubs | |
| id: save-perfstubs | |
| uses: actions/cache/save@v3 | |
| with: | |
| path: ${{runner.workspace}}/build-perfstubs/install | |
| key: ${{ steps.restore-perfstubs.outputs.cache-primary-key }} | |
| - name: Redev Checkout repo | |
| uses: actions/checkout@v3 | |
| with: | |
| path: redev | |
| - name: Redev Create Build Environment | |
| run: /usr/bin/cmake -E make_directory ${{runner.workspace}}/build-redev | |
| - name: Redev Configure CMake | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build-redev | |
| run: /usr/bin/cmake $GITHUB_WORKSPACE/redev | |
| -DCMAKE_CXX_COMPILER=mpicxx | |
| -DCMAKE_C_COMPILER=mpicc | |
| -DMPIEXEC_PREFLAGS="--oversubscribe" | |
| -DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
| -DADIOS2_DIR=${{runner.workspace}}/build-adios2/install/lib/cmake/adios2/ | |
| -DADIOS2_HAVE_SST=ON | |
| -DADIOS2_BPLS_PATH=${{runner.workspace}}/build-adios2/install/bin/bpls | |
| -Dperfstubs_DIR=${{runner.workspace}}/build-perfstubs/install/lib/cmake/ | |
| -DBUILD_TESTING=ON | |
| # Initializes the CodeQL tools for scanning. This must be done before the code is built. | |
| #- name: Initialize CodeQL | |
| # uses: github/codeql-action/init@v2 | |
| # with: | |
| # languages: ${{ matrix.language }} | |
| # queries: security-and-quality | |
| # source-root: redev | |
| - name: Redev Build | |
| working-directory: ${{runner.workspace}}/build-redev | |
| shell: bash | |
| run: /usr/bin/cmake --build . --parallel 2 | |
| - name: Redev Test | |
| working-directory: ${{runner.workspace}}/build-redev | |
| shell: bash | |
| run: ctest --timeout 10 --output-on-failure | |
| #- name: Perform CodeQL Analysis | |
| # uses: github/codeql-action/analyze@v2 |