|
| 1 | +name: Cuda unit tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + python_version: |
| 7 | + required: false |
| 8 | + type: string |
| 9 | + ref: |
| 10 | + required: false |
| 11 | + type: string |
| 12 | + check_run_id: |
| 13 | + required: false |
| 14 | + type: string |
| 15 | + pr_repo: |
| 16 | + required: false |
| 17 | + type: string |
| 18 | + push: |
| 19 | + branches: [devel, main] |
| 20 | + |
| 21 | +env: |
| 22 | + COMMIT: ${{ inputs.ref || github.event.ref }} |
| 23 | + PEM: ${{ secrets.BOT_PEM }} |
| 24 | + GITHUB_RUN_ID: ${{ github.run_id }} |
| 25 | + GITHUB_CHECK_RUN_ID: ${{ inputs.check_run_id }} |
| 26 | + PR_REPO: ${{ inputs.pr_repo || github.repository }} |
| 27 | + |
| 28 | +jobs: |
| 29 | + Cuda: |
| 30 | + |
| 31 | + runs-on: ubuntu-20.04 |
| 32 | + name: Unit tests |
| 33 | + |
| 34 | + container: nvidia/cuda:11.7.1-devel-ubuntu20.04 |
| 35 | + steps: |
| 36 | + - name: Prepare docker |
| 37 | + run: | |
| 38 | + apt update && apt install sudo |
| 39 | + TZ=Europe/France |
| 40 | + ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
| 41 | + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata |
| 42 | + sudo apt install -y git |
| 43 | + shell: bash |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + with: |
| 46 | + ref: ${{ env.COMMIT }} |
| 47 | + repository: ${{ env.PR_REPO }} |
| 48 | + submodules: true |
| 49 | + - name: Install python (setup-python action doesn't work with containers) |
| 50 | + uses: ./.github/actions/python_install |
| 51 | + - name: "Setup" |
| 52 | + id: token |
| 53 | + run: | |
| 54 | + pip install jwt requests |
| 55 | + python ci_tools/setup_check_run.py cuda |
| 56 | + - name: CUDA Version |
| 57 | + run: nvcc --version # cuda install check |
| 58 | + - name: Install dependencies |
| 59 | + uses: ./.github/actions/linux_install |
| 60 | + - name: Install Pyccel with tests |
| 61 | + run: | |
| 62 | + PATH=${PATH}:$HOME/.local/bin |
| 63 | + echo "PATH=${PATH}" >> $GITHUB_ENV |
| 64 | + python -m pip install --upgrade pip |
| 65 | + python -m pip install --user .[test] |
| 66 | + shell: bash |
| 67 | + - name: Coverage install |
| 68 | + uses: ./.github/actions/coverage_install |
| 69 | + - name: Ccuda tests with pytest |
| 70 | + id: cuda_pytest |
| 71 | + uses: ./.github/actions/pytest_run_cuda |
| 72 | + - name: Collect coverage information |
| 73 | + continue-on-error: True |
| 74 | + uses: ./.github/actions/coverage_collection |
| 75 | + - name: Save code coverage report |
| 76 | + uses: actions/upload-artifact@v3 |
| 77 | + with: |
| 78 | + name: coverage-artifact |
| 79 | + path: .coverage |
| 80 | + retention-days: 1 |
| 81 | + include-hidden-files: true |
| 82 | + - name: "Post completed" |
| 83 | + if: always() |
| 84 | + run: |
| 85 | + python ci_tools/complete_check_run.py ${{ steps.cuda_pytest.outcome }} |
| 86 | + |
0 commit comments