Skip to content

Commit 8f4e275

Browse files
committed
GitHub Action to run make check
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 84d979f commit 8f4e275

3 files changed

Lines changed: 42 additions & 30 deletions

File tree

.github/workflows/check.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Run tests
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install dependencies
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y shellcheck cppcheck
22+
23+
- name: Bootstrap
24+
run: ./bootstrap.sh
25+
26+
- name: Configure
27+
run: ./configure --enable-debug
28+
29+
- name: Build
30+
run: make -j$(nproc)
31+
32+
- name: Run tests
33+
run: make check
34+
35+
- name: Upload test logs on failure
36+
if: failure()
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: test-logs
40+
path: tests/testsuite.log

.github/workflows/format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check formatting on sources
1+
name: Check formatting
22

33
on:
44
push:
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Install dependencies
18-
run: sudo apt install shfmt clang-format
18+
run: sudo apt -y install shfmt clang-format
1919
- name: Initial setup
2020
run: ./bootstrap.sh
2121
- name: Configure

tests/testsuite.at

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -291,20 +291,6 @@ AT_CLEANUP
291291

292292
########################################
293293

294-
AT_SETUP([Check formatting on C code])
295-
296-
# Skip if clang-format is not installed
297-
AT_SKIP_IF([! command -v clang-format])
298-
299-
# Run clang-format on all source files
300-
for file in "$abs_top_builddir"/**/*.{c,h}; do
301-
AT_CHECK([clang-format --dry-run --Werror "$file"])
302-
done
303-
304-
AT_CLEANUP
305-
306-
########################################
307-
308294
AT_SETUP([Static check C code])
309295

310296
# Skip if cppcheck is not installed
@@ -319,20 +305,6 @@ AT_CLEANUP
319305

320306
########################################
321307

322-
AT_SETUP([Check formatting on shell scripts])
323-
324-
# Skip if shfmt is not installed
325-
AT_SKIP_IF([! command -v shfmt])
326-
327-
# Run shfmt on all shell files
328-
for file in "$abs_top_builddir"/**/*.sh; do
329-
AT_CHECK([shfmt --diff "$file"])
330-
done
331-
332-
AT_CLEANUP
333-
334-
########################################
335-
336308
AT_SETUP([Static check shell scripts])
337309

338310
# Skip if shellcheck is not installed

0 commit comments

Comments
 (0)