chore(ci): improve C/C++ CI workflow for reliability and clarity

This commit is contained in:
sankalp committed 2025-10-07 22:10:02 +05:45
1 parent b595fa58bb
commit 72ac73086e
1 file changed
+30 -10
+30 -10
View File
@@ -1,3 +1,4 @@
name: C/C++ CI
on:
@@ -8,16 +9,35 @@ on:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck
# Step 1: Checkout your code
- name: Checkout code
uses: actions/checkout@v4
# Step 2: Install build dependencies
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential
# Step 3: Build your project
- name: Build
run: make -j$(nproc)
# Step 4: Run tests if available
- name: Run tests
run: |
if make -q check 2>/dev/null; then
make check
else
echo "No tests defined, skipping..."
fi
# Step 5: Optional: distribution check if Makefile has distcheck
- name: Distribution check
run: |
if make -q distcheck 2>/dev/null; then
make distcheck
else
echo "No distcheck target, skipping..."
fi