Skip to content

Commit 40a830c

Browse files
committed
Conform line endings
1 parent a68d429 commit 40a830c

5 files changed

Lines changed: 280 additions & 224 deletions

File tree

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{c,h,cpp,hpp}]
12+
indent_size = 2
13+
14+
[*.{bat,cmd}]
15+
end_of_line = crlf
16+
17+
[Makefile]
18+
indent_style = tab
19+
20+
[*.{yml,yaml}]
21+
indent_size = 2

.gitattributes

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
* text=auto
2+
3+
# C/C++ files
4+
*.c text
5+
*.h text
6+
*.cpp text
7+
*.hpp text
8+
9+
# Shell scripts and batch files
10+
*.sh text eol=lf
11+
*.bat text eol=crlf
12+
*.cmd text eol=crlf
13+
14+
# CMake and build system files
15+
*.cmake text
16+
CMakeLists.txt text
17+
*.in text
18+
*.plist text
19+
20+
# Documentation and text files
21+
*.md text
22+
*.txt text
23+
LICENSE* text
24+
25+
# YAML files
26+
*.yml text
27+
*.yaml text
28+
29+
# Dockerfiles
30+
*.Dockerfile text
31+
32+
# Binaries
33+
*.icns binary
34+
*.png binary
35+
*.jpg binary

.github/workflows/ci.yml

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
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

Comments
 (0)