Skip to content

Commit 9c28003

Browse files
committed
Add CI check
Signed-off-by: Gaurav Aggarwal <[email protected]>
1 parent 341a8dc commit 9c28003

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build Check
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
env:
8+
bashPass: \033[32;1mPASSED -
9+
bashWarn: \033[33;1mWARNING -
10+
bashFail: \033[31;1mFAILED -
11+
bashEnd: \033[0m
12+
13+
jobs:
14+
BUILD-CHECK:
15+
name: Build Check
16+
runs-on: ubuntu-latest
17+
steps:
18+
- env:
19+
stepName: Checkout Repository
20+
name: ${{ env.stepName }}
21+
uses: actions/checkout@v4
22+
23+
- env:
24+
stepName: Install Tools
25+
name: ${{ env.stepName }}
26+
shell: bash
27+
run: |
28+
# ${{ env.stepName }}
29+
echo -e "::group::${{ env.stepName }}"
30+
set +e
31+
sudo apt-get -y update
32+
sudo apt-get -y install build-essential
33+
exitStatus=$?
34+
set -e
35+
echo -e "::endgroup::"
36+
if [ $exitStatus -eq 0 ]; then
37+
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
38+
else
39+
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
40+
exit 1
41+
fi
42+
43+
- env:
44+
stepName: Build
45+
name: ${{ env.stepName }}
46+
id: build-test
47+
shell: bash
48+
working-directory: test/posix_build_test
49+
run: |
50+
# ${{ env.stepName }}
51+
echo -e "::group::${{ env.stepName }}"
52+
set +e
53+
cmake -S . -B build
54+
make -C build -j
55+
exitStatus=$?
56+
set -e
57+
echo -e "::endgroup::"
58+
if [ $exitStatus -eq 0 ]; then
59+
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
60+
else
61+
echo -e "${{ env.bashFail }} ${{ env.stepName }} ${{ env.bashEnd }}"
62+
exit 1
63+
fi

0 commit comments

Comments
 (0)