|
| 1 | +name: CI with TFEL and CUDA support on Ubuntu |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "master" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "master" ] |
| 8 | + |
| 9 | +env: |
| 10 | + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
| 11 | + BUILD_TYPE: Release |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + |
| 20 | + - name: Install CUDA |
| 21 | + uses: Jimver/cuda-toolkit@v0.2.36 |
| 22 | + with: |
| 23 | + id: cuda-toolkit |
| 24 | + |
| 25 | + - name: Print CUDA version |
| 26 | + run: | |
| 27 | + echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}" |
| 28 | + echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}" |
| 29 | +
|
| 30 | + - name: Checkout TFEL |
| 31 | + uses: actions/checkout@v7 |
| 32 | + with: |
| 33 | + repository: thelfer/tfel |
| 34 | + path: tfel |
| 35 | + |
| 36 | + - name: Checkout MGIS |
| 37 | + uses: actions/checkout@v7 |
| 38 | + with: |
| 39 | + path: mgis |
| 40 | + |
| 41 | + - name: Install TFEL |
| 42 | + run: | |
| 43 | + cmake ${{github.workspace}}/tfel \ |
| 44 | + -B ${{github.workspace}}/build-tfel \ |
| 45 | + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ |
| 46 | + -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install-tfel |
| 47 | + cmake --build ${{github.workspace}}/build-tfel --target all -j $(nproc) |
| 48 | + cmake --build ${{github.workspace}}/build-tfel --target install |
| 49 | +
|
| 50 | + - name: Configure |
| 51 | + run: | |
| 52 | + source ${{github.workspace}}/install-tfel/share/tfel/env/env.sh |
| 53 | + cmake ${{github.workspace}}/mgis \ |
| 54 | + -B ${{github.workspace}}/build \ |
| 55 | + -DCMAKE_BUILD_TYPE=Release \ |
| 56 | + -Denable-c-bindings=ON \ |
| 57 | + -Denable-fortran-bindings=ON \ |
| 58 | + -Denable-python-bindings=OFF \ |
| 59 | + -Denable-portable-build=ON \ |
| 60 | + -Denable-julia-bindings=OFF \ |
| 61 | + -Denable-parallel-stl-algorithms=OFF \ |
| 62 | + -Denable-cuda-algorithms=ON \ |
| 63 | + -DTFEL_DIR=${{github.workspace}}/install-tfel/share/tfel/cmake \ |
| 64 | + -DCMAKE_CUDA_COMPILER=nvcc \ |
| 65 | + -DCUDA_ARCHITECTURES=native |
| 66 | +
|
| 67 | + - name: Compile |
| 68 | + run: | |
| 69 | + source ${{github.workspace}}/install-tfel/share/tfel/env/env.sh |
| 70 | + cmake --build ${{github.workspace}}/build --target all -j $(nproc) |
| 71 | +
|
| 72 | + # - name: Test |
| 73 | + # run: | |
| 74 | + # source ${{github.workspace}}/install-tfel/share/tfel/env/env.sh |
| 75 | + # cmake --build ${{github.workspace}}/build --target check -j $(nproc) |
| 76 | + |
| 77 | + # - name: Print test log on failure |
| 78 | + # if: failure() |
| 79 | + # run: | |
| 80 | + # cat ${{github.workspace}}/build/Testing/Temporary/*.log |
| 81 | + |
| 82 | + # - name: Publish test report |
| 83 | + # uses: mikepenz/action-junit-report@v6 |
| 84 | + # if: success() || failure() # always run even if the previous step fails |
| 85 | + # with: |
| 86 | + # report_paths: '**/build/tests/*.xml' |
0 commit comments