-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.32 KB
/
ci.yml
File metadata and controls
51 lines (43 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: CI
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
jobs:
build:
uses: SamuelMarks/c-ci/.github/workflows/c-cmake-ci.yml@master
with:
cmake_configure_flags: '-DC89STRINGUTILS_BUILD_AMALGAMATION=ON'
project_name: 'c89stringutils'
test-amalg:
name: Test Amalgamation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate amalgamation
run: |
cmake -B build -DC89STRINGUTILS_BUILD_AMALGAMATION=ON
cmake --build build
- name: Create Test File
run: |
cat << 'EOF' > test_amalg.c
#define C89STRINGUTILS_IMPLEMENTATION
#include "build/c89stringutils/c89stringutils_amalgamation.h"
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char* x = NULL;
int len = asprintf(&x, "hello %s", "world");
if (len > 0 && x != NULL) {
printf("%s\n", x);
free(x);
return 0;
}
return 1;
}
EOF
- name: Compile Test Amalgamation
run: gcc -Wall -Wextra -Werror -o test_amalg test_amalg.c
- name: Run Test Amalgamation
run: ./test_amalg