Add cuda workflow to test cuda developments on CI #308
This file contains 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: 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 }} | |