Skip to content

Commit 2a6df02

Browse files
Enhance CI workflow with OS matrix and dependencies
Added OS matrix strategy for CI build and improved dependency installation steps for Linux and macOS.
1 parent d4abcaf commit 2a6df02

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/c-cpp.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install dependencies (Linux)
20+
if: runner.os == 'Linux'
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y build-essential
24+
25+
- name: Install dependencies (macOS)
26+
if: runner.os == 'macOS'
27+
run: |
28+
brew install make
29+
30+
- name: Build with Make
31+
run: make
32+
33+
- name: Test executable exists
34+
run: |
35+
if [ "${{ runner.os }}" == "Windows" ]; then
36+
if [ ! -f "mas.exe" ]; then
37+
echo "Build failed: mas.exe not found"
38+
exit 1
39+
fi
40+
else
41+
if [ ! -f "mas.exe" ]; then
42+
echo "Build failed: mas.exe not found"
43+
exit 1
44+
fi
45+
fi
46+
47+
- name: Clean build artifacts
48+
run: make clean

0 commit comments

Comments
 (0)