From 6f93844ec379981ba8dbca2e0527c103bad3d839 Mon Sep 17 00:00:00 2001 From: Deshan Perera <55466094+DeshanPerera@users.noreply.github.com> Date: Wed, 11 Sep 2024 06:08:43 -0600 Subject: [PATCH] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index dd313af..61bff38 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -1,4 +1,4 @@ -name: C/C++ CI +name: C/C++ CUDA CI on: push: @@ -8,18 +8,23 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + # Install CUDA toolkit - name: Install CUDA run: | + sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub + sudo sh -c 'echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list' sudo apt-get update - sudo apt-get install -y cuda - - name: Configure - run: ./configure - - name: Compile - run: nvcc -std=c++17 *.cu *.cpp -o output_binary - - name: Run Tests - run: ./output_binary -h + sudo apt-get -y install cuda + + # Compile using nvcc + - name: Compile CUDA code + run: nvcc -std=c++17 *.cu *.cpp -o output_executable + + # Optionally, run tests (if applicable) + - name: Run tests + run: ./output_executable