forked from pyccel/pyccel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cuda workflow to test cuda developments on CI
- Loading branch information
1 parent
2c16959
commit 03762c9
Showing
10 changed files
with
137 additions
and
14 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: 'Pyccel pytest commands generating Ccuda' | ||
inputs: | ||
shell_cmd: | ||
description: 'Specifies the shell command (different for anaconda)' | ||
required: false | ||
default: "bash" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Ccuda tests with pytest | ||
run: | | ||
# Catch exit 5 (no tests found) | ||
sh -c 'python -m pytest -n auto -rx -m "not (parallel or xdist_incompatible) and ccuda" --ignore=symbolic --ignore=ndarrays; ret=$?; [ $ret = 5 ] && exit 0 || exit $ret' | ||
pyccel-clean | ||
shell: ${{ inputs.shell_cmd }} | ||
working-directory: ./tests |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: 'Python installation commands' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install python | ||
run: | ||
sudo apt-get -y install python3-dev | ||
shell: bash | ||
- name: python as python3 | ||
run: | ||
sudo apt-get -y install python-is-python3 | ||
shell: bash | ||
- name: Install Pip | ||
run: | ||
sudo apt-get -y install python3-pip | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
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 }} | ||
submodules: true | ||
- 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: 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 }} | ||
|
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
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
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
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