Skip to content

Commit 4a0c804

Browse files
ChristosMatzorosChristos Konstantinos Matzoros
andauthored
Create CI yml file (#5)
* Create main.yml --------- Co-authored-by: Christos Konstantinos Matzoros <[email protected]>
1 parent 686dc24 commit 4a0c804

File tree

1 file changed

+178
-0
lines changed

1 file changed

+178
-0
lines changed

.github/workflows/main.yml

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
name: OSP CI
2+
3+
on:
4+
push:
5+
branches: ["*"]
6+
7+
jobs:
8+
# -------------------------------------------------
9+
# 1. MULTI-CONFIGURATION BUILD TESTS
10+
# -------------------------------------------------
11+
build_matrix:
12+
name: Build (${{ matrix.build_type }})
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
build_type: [Debug, RelWithDebInfo, Release, RelWithDebInfo-noEigen]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Install dependencies
22+
if: matrix.build_type != 'RelWithDebInfo-noEigen'
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y --no-install-recommends \
26+
make gcc g++ git libboost-all-dev \
27+
doxygen graphviz python3-pip libeigen3-dev
28+
pip3 install --upgrade pip
29+
pip3 install cmake==3.21.3
30+
31+
- name: Install dependencies (no Eigen)
32+
if: matrix.build_type == 'RelWithDebInfo-noEigen'
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y --no-install-recommends \
36+
make gcc g++ git libboost-all-dev \
37+
doxygen graphviz python3-pip
38+
pip3 install --upgrade pip
39+
pip3 install cmake==3.21.3
40+
41+
- name: Configure (${{ matrix.build_type }})
42+
run: |
43+
if [ "${{ matrix.build_type }}" = "RelWithDebInfo-noEigen" ]; then
44+
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
45+
else
46+
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
47+
fi
48+
49+
- name: Build (${{ matrix.build_type }})
50+
working-directory: ${{ github.workspace }}/build
51+
run: cmake --build . -j$(nproc)
52+
53+
# -------------------------------------------------
54+
# 2. FULL BUILD + TEST + SIMPLE DAG RUN (with Eigen)
55+
# -------------------------------------------------
56+
test_and_run:
57+
name: Build & Test (RelWithDebInfo + Eigen)
58+
runs-on: ubuntu-latest
59+
needs: build_matrix
60+
61+
steps:
62+
- uses: actions/checkout@v3
63+
64+
- name: Install dependencies
65+
run: |
66+
sudo apt-get update
67+
sudo apt-get install -y --no-install-recommends \
68+
make gcc g++ git libboost-all-dev \
69+
doxygen graphviz python3-pip libeigen3-dev
70+
pip3 install --upgrade pip
71+
pip3 install cmake==3.21.3
72+
73+
- name: Configure
74+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTS=ON
75+
76+
- name: Build all targets
77+
working-directory: ${{ github.workspace }}/build
78+
run: cmake --build . -j$(nproc)
79+
80+
- name: Run tests
81+
working-directory: ${{ github.workspace }}/build
82+
run: ctest --output-on-failure --output-junit test_results.xml
83+
continue-on-error: true
84+
85+
- name: Upload test results
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: test-results
89+
path: build/test_results.xml
90+
91+
- name: Run osp example
92+
working-directory: ${{ github.workspace }}/build
93+
run: |
94+
./apps/osp \
95+
--inputDag ../data/spaa/tiny/instance_bicgstab.hdag \
96+
--inputMachine ../data/machine_params/p3.arch \
97+
--Serial --GreedyBsp --BspLocking --GrowLocal --Variance --Cilk \
98+
--Etf --GreedyChildren --MultiHC --SarkarLockingHC \
99+
--GreedyChildrenKL --GrowLocalKL --GreedyBspHC --FunnelLocking
100+
101+
# -------------------------------------------------
102+
# 3. FULL BUILD + TEST (NO EIGEN)
103+
# -------------------------------------------------
104+
test_no_eigen:
105+
name: Build & Test (RelWithDebInfo, no Eigen)
106+
runs-on: ubuntu-latest
107+
needs: build_matrix
108+
109+
steps:
110+
- uses: actions/checkout@v3
111+
112+
- name: Install dependencies
113+
run: |
114+
sudo apt-get update
115+
sudo apt-get install -y --no-install-recommends \
116+
make gcc g++ git libboost-all-dev \
117+
doxygen graphviz python3-pip
118+
pip3 install --upgrade pip
119+
pip3 install cmake==3.21.3
120+
121+
- name: Configure
122+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTS=ON
123+
124+
- name: Build all targets
125+
working-directory: ${{ github.workspace }}/build
126+
run: cmake --build . -j$(nproc)
127+
128+
- name: Run tests
129+
working-directory: ${{ github.workspace }}/build
130+
run: ctest --output-on-failure --output-junit test_results_no_eigen.xml
131+
continue-on-error: true
132+
133+
- name: Upload test results
134+
uses: actions/upload-artifact@v4
135+
with:
136+
name: test-results-no-eigen
137+
path: build/test_results_no_eigen.xml
138+
139+
- name: Run osp example
140+
working-directory: ${{ github.workspace }}/build
141+
run: |
142+
./apps/osp \
143+
--inputDag ../data/spaa/tiny/instance_bicgstab.hdag \
144+
--inputMachine ../data/machine_params/p3.arch \
145+
--Serial --GreedyBsp --BspLocking --GrowLocal --Variance --Cilk \
146+
--Etf --GreedyChildren --MultiHC --SarkarLockingHC \
147+
--GreedyChildrenKL --GrowLocalKL --GreedyBspHC --FunnelLocking
148+
149+
# -------------------------------------------------
150+
# 4. BUILD DOCUMENTATION (only on master)
151+
# -------------------------------------------------
152+
docs:
153+
name: Build Docs
154+
runs-on: ubuntu-latest
155+
needs: [test_and_run, test_no_eigen]
156+
if: github.ref == 'refs/heads/master'
157+
158+
steps:
159+
- uses: actions/checkout@v3
160+
161+
- name: Install dependencies
162+
run: |
163+
sudo apt-get update
164+
sudo apt-get install -y --no-install-recommends \
165+
doxygen graphviz libeigen3-dev cmake g++
166+
167+
- name: Build docs
168+
run: |
169+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
170+
cmake --build build --target doc
171+
mkdir -p public
172+
cp -r doc/html/* public
173+
174+
- name: Upload docs artifact
175+
uses: actions/upload-artifact@v4
176+
with:
177+
name: docs
178+
path: public

0 commit comments

Comments
 (0)