added missing copys #191
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: CPU Compilation/Unit Tests | |
| on: | |
| push: | |
| pull_request: | |
| types: [ready_for_review] | |
| jobs: | |
| check-commit: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| run_tests: ${{ steps.check_message.outputs.run_tests }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Check commit message | |
| id: check_message | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.action }}" == "ready_for_review" ]]; then | |
| echo "run_tests=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| if git log -1 --pretty=%B | grep -q "CPUTEST"; then | |
| echo "run_tests=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "run_tests=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| tests: | |
| needs: check-commit | |
| if: needs.check-commit.outputs.run_tests == 'true' | |
| name: UNIT_TESTS (precision=${{ matrix.precision }}, mpi=${{ matrix.mpi }}, output=${{ matrix.output }}) | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| precision: [single, double] | |
| mpi: [ON, OFF] | |
| output: [ON, OFF] | |
| exclude: | |
| - precision: single | |
| mpi: ON | |
| output: ON | |
| - precision: double | |
| mpi: ON | |
| output: ON | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install GCC 14 and build tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-14 g++-14 gfortran-14 build-essential wget libevent-dev libhwloc-dev | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50 | |
| sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 50 | |
| gcc --version | |
| g++ --version | |
| - name: Install CMake (3.x) | |
| run: | | |
| sudo apt-get install -y cmake | |
| cmake --version | |
| - name: Install OpenMPI 5 | |
| run: | | |
| if [ "${{ matrix.mpi }}" = "ON" ]; then | |
| sudo apt-get install -y libopenmpi-dev openmpi-bin | |
| mpirun --version | |
| fi | |
| - name: Configure | |
| run: | | |
| if [ "${{ matrix.mpi }}" = "ON" ]; then | |
| export CC=mpicc | |
| export CXX=mpicxx | |
| else | |
| export CC=gcc-14 | |
| export CXX=g++-14 | |
| fi | |
| cmake -B build -D TESTS=ON -D precision=${{ matrix.precision }} -D mpi=${{ matrix.mpi }} -D output=${{ matrix.output }} | |
| - name: Compile | |
| run: cmake --build build -j "$(nproc)" | |
| - name: Run tests | |
| run: ctest --test-dir build --output-on-failure | |
| pgens: | |
| needs: check-commit | |
| if: needs.check-commit.outputs.run_tests == 'true' | |
| name: PGENS (pgen=${{ matrix.pgen }}) | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| pgen: [streaming, turbulence, reconnection, shock, magnetosphere, accretion, wald, examples/custom_emission, examples/external_fields] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install GCC 14 and build tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-14 g++-14 gfortran-14 build-essential wget libevent-dev libhwloc-dev | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50 | |
| sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 50 | |
| gcc --version | |
| g++ --version | |
| - name: Install CMake (3.x) | |
| run: | | |
| sudo apt-get install -y cmake | |
| cmake --version | |
| - name: Configure | |
| run: | | |
| cmake -B build -D pgen=${{ matrix.pgen }} -D output=OFF | |
| - name: Compile | |
| run: cmake --build build -j "$(nproc)" |