Skip to content

Commit a3afc0c

Browse files
authored
ci: example
1 parent de3a469 commit a3afc0c

File tree

2 files changed

+29
-42
lines changed

2 files changed

+29
-42
lines changed

.github/workflows/example.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: build-hello-world
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-hello-world:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: install g++
16+
run: sudo apt install -y g++ cppcheck
17+
18+
- name: run cppcheck
19+
run: |
20+
cppcheck hello_world.cpp --output-file=report.txt
21+
if [ -s report.txt ]; then # if file is not empty
22+
cat report.txt
23+
exit 1 # let github action fails
24+
fi
25+
26+
- name: check build
27+
run: |
28+
g++ hello_world.cpp -o hello_world
29+
./hello_world

.github/workflows/release.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)