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