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