|
1 | | -name: Makefile CI |
| 1 | +name: Build with CUDA and C++ |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ "main" ] |
| 5 | + branches: |
| 6 | + - main |
6 | 7 | pull_request: |
7 | | - branches: [ "main" ] |
| 8 | + branches: |
| 9 | + - main |
8 | 10 |
|
9 | 11 | jobs: |
10 | 12 | build: |
11 | | - runs-on: ubuntu-latest |
12 | | - |
| 13 | + runs-on: ubuntu-22.04 |
| 14 | + |
13 | 15 | steps: |
14 | | - - name: Checkout repository |
15 | | - uses: actions/checkout@v4 |
16 | | - |
17 | | - - name: Install CUDA Toolkit |
| 16 | + - name: Check out repository |
| 17 | + uses: actions/checkout@v3 |
| 18 | + |
| 19 | + - name: Install CUDA and dependencies |
18 | 20 | run: | |
| 21 | + # Add NVIDIA package repositories and key |
19 | 22 | sudo apt-get update |
20 | | - sudo apt-get install -y wget gnupg2 |
21 | | - # Add NVIDIA repository key |
22 | | - sudo mkdir -p /etc/apt/keyrings |
23 | | - wget -qO- https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub | sudo gpg --dearmor -o /etc/apt/keyrings/cuda.gpg |
24 | | - echo "deb [signed-by=/etc/apt/keyrings/cuda.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" | sudo tee /etc/apt/sources.list.d/cuda.list |
| 23 | + sudo apt-get install -y gnupg curl lsb-release |
| 24 | + curl https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin | sudo tee /etc/apt/preferences.d/cuda-repository-pin-600 |
| 25 | + curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pub | sudo tee /etc/apt/trusted.gpg.d/cuda.asc |
25 | 26 | sudo apt-get update |
26 | | - sudo apt-get -y install cuda-toolkit-11-7 |
27 | | -
|
28 | | - - name: Set up CUDA environment variables |
| 27 | + |
| 28 | + # Install CUDA (make sure to choose the right version you need) |
| 29 | + sudo apt-get install -y cuda-11-7 |
| 30 | + |
| 31 | + # Install other necessary dependencies like build-essential |
| 32 | + sudo apt-get install -y build-essential |
| 33 | +
|
| 34 | + # Verify that CUDA is installed |
| 35 | + nvcc --version |
| 36 | + g++ --version |
| 37 | +
|
| 38 | + - name: Build with Makefile |
29 | 39 | run: | |
30 | | - echo "PATH=/usr/local/cuda-11.7/bin:$PATH" >> $GITHUB_ENV |
31 | | - echo "LD_LIBRARY_PATH=/usr/local/cuda-11.7/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV |
32 | | -
|
33 | | - - name: Verify nvcc installation |
34 | | - run: nvcc --version |
35 | | - |
36 | | - - name: Configure |
37 | | - run: ./configure |
38 | | - |
39 | | - - name: Install dependencies |
40 | | - run: make |
41 | | - |
42 | | - - name: Run check |
43 | | - run: make check |
| 40 | + # Make sure the Makefile exists and then build the project |
| 41 | + if [ -f makefile ]; then |
| 42 | + make |
| 43 | + else |
| 44 | + echo "Makefile not found!" |
| 45 | + exit 1 |
| 46 | + fi |
| 47 | +
|
| 48 | + - name: Run tests (optional) |
| 49 | + run: | |
| 50 | + # Run tests if you have them defined |
| 51 | + # Example: ./test_program |
| 52 | + echo "No tests defined" |
44 | 53 |
|
45 | | - - name: Run distcheck |
46 | | - run: make distcheck |
|
0 commit comments