|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ unstable ] |
| 6 | + pull_request: |
| 7 | + branches: [ unstable ] |
| 8 | + workflow_call: |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +env: |
| 12 | + CMAKE_C_COMPILER_LAUNCHER: ccache |
| 13 | + CMAKE_CXX_COMPILER_LAUNCHER: ccache |
| 14 | + CCACHE_COMPILERCHECK: content |
| 15 | + CCACHE_BASEDIR: ${{ github.workspace }} |
| 16 | + CCACHE_DIR: ${{ github.workspace }}/.ccache |
| 17 | + CCACHE_MAXSIZE: 500M |
| 18 | + CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime |
| 19 | + CCACHE_COMPRESS: "1" |
| 20 | + CCACHE_COMPRESSLEVEL: "1" |
| 21 | + |
| 22 | +jobs: |
| 23 | + build_multi_node: |
| 24 | + |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + |
| 28 | + runs-on: ubuntu-24.04 |
| 29 | + |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v4 |
| 32 | + |
| 33 | + - uses: actions/cache/restore@v4 |
| 34 | + with: |
| 35 | + path: ${{ env.CCACHE_DIR }} |
| 36 | + key: ccache-${{ matrix.os }}-${{ matrix.cc }}-${{ github.run_id }} |
| 37 | + restore-keys: |
| 38 | + ccache-${{ matrix.os }}-${{ matrix.cc }}- |
| 39 | + |
| 40 | + - name: Install ubuntu dependencies |
| 41 | + run: > |
| 42 | + sudo apt-get update && sudo apt-get install ccache |
| 43 | +
|
| 44 | + - name: Build and start Docker Compose |
| 45 | + run: | |
| 46 | + docker compose build |
| 47 | + docker compose up -d |
| 48 | + working-directory: .github/workflows/docker |
| 49 | + |
| 50 | + - name: Compile MPI inside the container |
| 51 | + run: | |
| 52 | + docker exec -t -w ${{ github.workspace }} docker-vm-1 /bin/bash -euxc ' |
| 53 | + cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/install -DBuild_Documentation=Off |
| 54 | + cmake --build build/ -j2 |
| 55 | + ' |
| 56 | +
|
| 57 | + - name: Run tests inside the container |
| 58 | + run: | |
| 59 | + docker exec -t -w ${{ github.workspace }} docker-vm-1 /bin/bash -euxc ' |
| 60 | + export CTEST_OUTPUT_ON_FAILURE=1 |
| 61 | + cmake --build build/ --target test |
| 62 | + ' |
| 63 | +
|
| 64 | + - name: Run tests inside the container |
| 65 | + run: | |
| 66 | + docker exec -t -w ${{ github.workspace }} docker-vm-1 /bin/bash -euxc ' |
| 67 | + cat <<EOF | tee hostfile |
| 68 | + docker-vm-1 slots=3 |
| 69 | + docker-vm-2 slots=1 |
| 70 | + docker-vm-3 slots=2 |
| 71 | + EOF |
| 72 | +
|
| 73 | + # Test the communication |
| 74 | + mpirun -hostfile ./hostfile /bin/bash -c "env | grep \"^OMPI_COMM_.*_RANK\"" |
| 75 | +
|
| 76 | + # Run the actual test |
| 77 | + mpirun -hostfile ./hostfile build/test/c++/mpi_window |
| 78 | + ' |
| 79 | +
|
| 80 | + - name: ccache statistics |
| 81 | + if: always() |
| 82 | + run: ccache -sv |
| 83 | + |
| 84 | + - uses: actions/cache/save@v4 |
| 85 | + if: always() |
| 86 | + with: |
| 87 | + path: ${{ env.CCACHE_DIR }} |
| 88 | + key: ccache-${{ matrix.os }}-${{ matrix.cc }}-${{ github.run_id }} |
0 commit comments