|
| 1 | +name: Self-Hosted-CPU |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master, self-hosted-runner ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +env: |
| 11 | + build_dir: "build" |
| 12 | + config: "Release" |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + name: Build ${{ matrix.os }} GCC ${{ matrix.gcc }} CUDA ${{ matrix.cuda }} |
| 17 | + runs-on: self-hosted |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + include: |
| 22 | + - os: ubuntu-24.04 |
| 23 | + cuda: "12.8" |
| 24 | + gcc: 13 |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Cleanup workspace |
| 28 | + run: | |
| 29 | + rm -rf ${{ github.workspace }}/* |
| 30 | + rm -rf ${{ github.workspace }}/.* |
| 31 | +
|
| 32 | + - uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + submodules: recursive |
| 35 | + |
| 36 | + - name: Set environment variables |
| 37 | + run: | |
| 38 | + echo "CUDA_PATH=/usr/local/cuda-12.8" >> $GITHUB_ENV |
| 39 | + echo "${CUDA_PATH}/bin" >> $GITHUB_PATH |
| 40 | + echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV |
| 41 | + echo "CC=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV |
| 42 | + echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV |
| 43 | + echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV |
| 44 | + echo "CUDACXX=/usr/local/cuda-${{ matrix.cuda }}/bin/nvcc" >> $GITHUB_ENV |
| 45 | +
|
| 46 | + - name: Configure CMake build |
| 47 | + run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCUBOOL_BUILD_TESTS=ON -DCUBOOL_WITH_CUDA=OFF |
| 48 | + |
| 49 | + - name: Build library sources |
| 50 | + working-directory: ${{ env.build_dir }} |
| 51 | + run: cmake --build . --target all --verbose -j `nproc` |
| 52 | + |
| 53 | + test: |
| 54 | + name: Test ${{ matrix.cpu }} |
| 55 | + needs: build |
| 56 | + runs-on: self-hosted |
| 57 | + env: |
| 58 | + unit-test-file: test_all.txt |
| 59 | + regression-test-file: test_regression.txt |
| 60 | + strategy: |
| 61 | + fail-fast: false |
| 62 | + matrix: |
| 63 | + include: |
| 64 | + - cpu: Intel-Core-i7-4790 |
| 65 | + |
| 66 | + steps: |
| 67 | + - name: Run unit-tests |
| 68 | + working-directory: ${{ env.build_dir }} |
| 69 | + run: | |
| 70 | + chmod +x scripts/run_tests_all.sh |
| 71 | + ./scripts/run_tests_all.sh | tee ${{ env.unit-test-file }} |
| 72 | +
|
| 73 | + - name: Upload unit tests resutls |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: ${{ env.unit-test-file }} |
| 77 | + path: ${{ env.build_dir }}/${{ env.unit-test-file }} |
| 78 | + |
| 79 | + - name: Check for unit tests results |
| 80 | + working-directory: ${{ env.build_dir }} |
| 81 | + run: | |
| 82 | + if cat ${{ env.unit-test-file }} | grep -q "FAILED"; then |
| 83 | + exit 1 |
| 84 | + fi |
| 85 | +
|
| 86 | + - name: Run regression-tests |
| 87 | + working-directory: ${{ env.build_dir }}/python |
| 88 | + run: | |
| 89 | + chmod +x run_tests.sh |
| 90 | + ./run_tests.sh | tee ${{ env.regression-test-file }} |
| 91 | +
|
| 92 | + - name: Upload regression tests resutls |
| 93 | + uses: actions/upload-artifact@v4 |
| 94 | + with: |
| 95 | + name: ${{ env.regression-test-file }} |
| 96 | + path: ${{ env.build_dir }}/python/${{ env.regression-test-file }} |
| 97 | + |
| 98 | + - name: Check for regression tests results |
| 99 | + working-directory: ${{ env.build_dir }}/python |
| 100 | + run: | |
| 101 | + if cat ${{ env.regression-test-file }} | grep -q "FAILED"; then |
| 102 | + exit 1 |
| 103 | + fi |
0 commit comments