Skip to content

Commit 964db5b

Browse files
committed
build makefile script
1 parent 5429ec9 commit 964db5b

File tree

1 file changed

+40
-33
lines changed

1 file changed

+40
-33
lines changed

.github/workflows/makefile.yml

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,53 @@
1-
name: Makefile CI
1+
name: Build with CUDA and C++
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches:
6+
- main
67
pull_request:
7-
branches: [ "main" ]
8+
branches:
9+
- main
810

911
jobs:
1012
build:
11-
runs-on: ubuntu-latest
12-
13+
runs-on: ubuntu-22.04
14+
1315
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
1820
run: |
21+
# Add NVIDIA package repositories and key
1922
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
2526
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
2939
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"
4453
45-
- name: Run distcheck
46-
run: make distcheck

0 commit comments

Comments
 (0)