update build.yml #13
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 | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 # <-- Upgraded from @v4 | |
| - name: Install compiler and dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| libopenmpi-dev \ | |
| openmpi-bin | |
| - name: Configure CMake | |
| # Creates the build directory and generates build files automatically | |
| run: cmake -B build -S . | |
| - name: Build project | |
| # Compiles the target inside the build directory using all available cores | |
| run: cmake --build build -j $(nproc) | |
| - name: Run executable | |
| run: | | |
| # We use mpirun with 2 ranks to verify our MPI environment | |
| # is fully operational within the GitHub environment! | |
| mpirun -np 2 ./build/miniClimate \ | |
| --nx 64 \ | |
| --ny 64 \ | |
| --steps 10 |