Skip to content

Commit 0755de4

Browse files
authored
Merge branch 'develop' into unsigned-integers
2 parents 7287dd9 + d9037b1 commit 0755de4

13 files changed

Lines changed: 273 additions & 163 deletions

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ The commands above will automatically install all the dependencies using [Python
106106
### 4. Format source files
107107

108108
[GitHub Actions](https://github.com/fktn-k/fkYAML/actions) will test the updated project with the [Clang-Format](https://github.com/llvm/llvm-project/releases/tag/llvmorg-18.1.3) tool (18.1.3) once you open a PR or push commits afterwards which include changes in the source files under either [`include`](https://github.com/fktn-k/fkYAML/tree/develop/include) or [`test`](https://github.com/fktn-k/fkYAML/tree/develop/test) directories.
109-
Although code formatting is automatically executed in the GitHub Actions workflows, you can run the script files ([`run_clang_format.bat`](https://github.com/fktn-k/fkYAML/blob/develop/scripts/run_clang_format.bat) for Windows, [`run_clang_format.sh`](https://github.com/fktn-k/fkYAML/blob/develop/scripts/run_clang_format.sh) otherwise) to check if your changes follow the rules defined in the [`.clang-format`](https://github.com/fktn-k/fkYAML/blob/develop/.clang-format) file on your local environment in advance.
109+
Although format check is automatically executed in the GitHub Actions workflows, you can run the script files ([`run_clang_format.bat`](https://github.com/fktn-k/fkYAML/blob/develop/scripts/run_clang_format.bat) for Windows, [`run_clang_format.sh`](https://github.com/fktn-k/fkYAML/blob/develop/scripts/run_clang_format.sh) otherwise) to check if your changes follow the rules defined in the [`.clang-format`](https://github.com/fktn-k/fkYAML/blob/develop/.clang-format) file on your local environment in advance.
110110
Note that, since the Clang-Format tool does not gurantee backward compatibility especially in its edge cases and its behaviors might therefore vary from version to version, it's highly recommended that you use the above script files to avoid unnecessary confusion for that kind of reason.
111111
The scripts uses [the Clang-Format Python distribution](https://pypi.org/project/clang-format/18.1.3/) and installs it using [the Python venv module](https://docs.python.org/3/library/venv.html) if it's not been installed yet.
112112
You can run the scripts with the following commands:

.github/copilot-instructions.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Copilot instructions for fkYAML
2+
3+
## Project overview
4+
- This repository contains fkYAML, a header-only C++ YAML library.
5+
- The library is designed to be portable, dependency-light, and compatible with C++11 and later.
6+
- Public API changes should preserve existing behavior unless the task explicitly requires otherwise.
7+
8+
## Coding guidelines
9+
- Prefer small, localized changes that match the existing style of the codebase.
10+
- Keep the implementation header-only friendly and avoid introducing new external dependencies.
11+
- Follow the existing naming conventions:
12+
- namespaces: `fkyaml` and `detail`
13+
- macros: `FK_YAML_*`
14+
- functions and variables: snake_case
15+
- types: descriptive names such as `basic_node`, `node`, `node_type`
16+
- other conventions: described in the `.clang-format` and `.clang-tidy` files at the root of the repository.
17+
- Preserve existing namespace and include patterns when editing headers under `include/fkYAML/`.
18+
- Add the consistent copyright header to new files and maintain it in existing files.
19+
- Keep comments and documentation concise and useful.
20+
21+
## Build and test
22+
- The primary build system is CMake.
23+
- Typical local validation flow:
24+
1. `cmake -S . -B build -DFK_YAML_BUILD_TEST=ON`
25+
2. `cmake --build build`
26+
3. `ctest --test-dir build --output-on-failure`
27+
- If a change affects parsing, serialization, or node behavior, add or update tests in `tests/unit_test/`.
28+
29+
## Directory structure
30+
- `/.github/`: GitHub-specific configuration files
31+
- `/.github/workflows/`: CI/CD workflow definitions
32+
- `/cmake/`: CMake package configuration and helper files
33+
- `/docs/`: Documentation files
34+
- `docs/`: Markdown documentation files
35+
- `/examples/`: Example usage files (mainly referenced in the documentation)
36+
- `/include/fkYAML/`: Core headers
37+
- `*.hpp`: Public headers
38+
- `detail/`: Implementation headers (not meant to be used directly by users)
39+
- `*.hpp`: Common headers
40+
- `conversions/*.hpp`: Conversion functions
41+
- `encodings/*.hpp`: Encoding/decoding functions
42+
- `input/*.hpp`: Deserialization functions from YAML to C++ types
43+
- `macros/*.hpp`: Macro definitions
44+
- `meta/*.hpp`: Type traits for metaprogramming
45+
- `output/*.hpp`: Serialization functions from C++ types to YAML
46+
- `types/*.hpp`: Enum type definitions
47+
- `/LICENSES/`: license files for the repository dependencies
48+
- `/scripts/`: Helper scripts for formatting, amalgamation, and repository maintenance
49+
- `/single_include/fkYAML/`: Amalgamated single-header distribution
50+
- `/tests/`: Test suite
51+
- `unit_test/`: Unit tests for all the functionalities of the library
52+
- `cmake_add_subdirectory_test/`: CMake integration test for add_subdirectory usage
53+
- `cmake_fetch_content_test/`: CMake integration test for FetchContent usage
54+
- `cmake_find_package_test/`: CMake integration test for find_package usage
55+
- `cmake_target_include_directories_test/`: CMake integration test for target_include_directories usage
56+
- `/thirdparty/`: Vendored dependencies (for testing and CI workflows, not part of the public API)
57+
- `/tools/`: Maintenance and benchmarking utilities
58+
59+
## Directory-specific guidance
60+
- `include/fkYAML/`: treat public headers as the stable API surface; prefer backward-compatible changes.
61+
- `include/fkYAML/detail/`: keep internal implementation headers consistent and avoid exposing unnecessary details.
62+
- `single_include/fkYAML/`: keep the amalgamated single-header distribution aligned with changes in the main headers; regenerate it when necessary.
63+
- `tests/`: keep the test suite organized and ensure changes are 100% covered by appropriate tests when there is any change in the codebase.
64+
- `thirdparty/`: avoid modifying vendored dependencies unless the task explicitly requires it.
65+
- `examples/`: keep examples simple, buildable, and consistent with the documented usage.
66+
- `docs/`: update documentation when public behavior or APIs change.
67+
- `tools/`: keep maintenance and benchmarking utilities compatible with the existing workflows.
68+
- `scripts/`: preserve helper scripts for formatting, amalgamation, and repository maintenance.
69+
- `cmake/`: keep package configuration and CMake helper files consistent with build changes.
70+
- `build/`: generated build output; do not edit manually.
71+
72+
## Compatibility and safety
73+
- Avoid breaking older compilers or C++11 compatibility.
74+
- Do not introduce C++14/17-only constructs unless the task explicitly requires them and the repository already supports them.
75+
- If a change affects the public API, consider updating related documentation and examples.
76+
- Respect the repository license headers and existing REUSE metadata.

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636

3737
steps:
3838
- name: Checkout repository
39-
uses: actions/checkout@v4
39+
uses: actions/checkout@v7
4040

4141
# Initializes the CodeQL tools for scanning.
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v3
43+
uses: github/codeql-action/init@v4
4444
with:
4545
languages: ${{ matrix.language }}
4646
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -67,6 +67,6 @@ jobs:
6767
cmake --build ${{github.workspace}}/build --config Release
6868
6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v3
70+
uses: github/codeql-action/analyze@v4
7171
with:
7272
category: "/language:${{matrix.language}}"

.github/workflows/coverage.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ jobs:
3131
pull-requests: write
3232

3333
steps:
34-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v7
3535
with:
36+
repository: ${{github.event.pull_request.head.repo.full_name}}
3637
ref: ${{github.head_ref}}
38+
persist-credentials: false
3739

3840
- name: Install lcov
3941
run: |
@@ -63,7 +65,7 @@ jobs:
6365
- name: Upload coverage as an artifact
6466
id: upload_artifact_step
6567
if: steps.create_zip.conclusion == 'success'
66-
uses: actions/upload-artifact@v4
68+
uses: actions/upload-artifact@v7
6769
with:
6870
name: ${{steps.create_zip.outputs.artifact_name}}
6971
path: |
@@ -73,7 +75,7 @@ jobs:
7375

7476
- name: Notify the artifact URL
7577
if: steps.upload_artifact_step.conclusion == 'success'
76-
uses: thollander/actions-comment-pull-request@v2
78+
uses: thollander/actions-comment-pull-request@v3
7779
with:
7880
message: |
7981
## :octocat: Upload Coverage Event Notification

.github/workflows/format_check.yml

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ jobs:
3636
timeout-minutes: 10
3737
runs-on: ubuntu-latest
3838
permissions:
39-
contents: write
39+
pull-requests: write
4040

4141
steps:
42-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@v7
4343
with:
44+
repository: ${{github.event.pull_request.head.repo.full_name}}
4445
ref: ${{github.head_ref}}
45-
token: ${{secrets.FKYAML_FORMAT_CHECK_PAT}}
46+
persist-credentials: false
4647

4748
- name: Run clang-format style check
4849
run: ${{github.workspace}}/scripts/run_clang_format.sh
@@ -52,14 +53,42 @@ jobs:
5253

5354
- name: Detect diffs caused by formatting scripts
5455
id: format_diff
55-
run: git diff --name-only --exit-code
56-
57-
- name: Commit and push the diffs
58-
if: failure() && steps.format_diff.outcome == 'failure'
56+
env:
57+
PR_NUMBER: ${{github.event.number}}
5958
run: |
60-
set -x
61-
git config user.name github-actions[bot]
62-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
63-
git add .
64-
git commit --author="$(git log --pretty=format:"%an <%ae>")" -m "[bot] run clang-format & amalgamation"
65-
git push
59+
git diff --patch --no-color > ${{github.workspace}}/format_diff_pr${{PR_NUMBER}}.patch
60+
if [ -s ${{github.workspace}}/format_diff_pr${{PR_NUMBER}}.patch ]; then
61+
echo "The source code has not been formatted/amalgamated correctly. Diff:"
62+
cat ${{github.workspace}}/format_diff_pr${{PR_NUMBER}}.patch
63+
echo "has_diff=true" >> $GITHUB_OUTPUT
64+
echo "Patch file created: format_diff_pr${{PR_NUMBER}}.patch"
65+
echo "patch_file_name=format_diff_pr${{PR_NUMBER}}.patch" >> $GITHUB_OUTPUT
66+
exit 1
67+
else
68+
echo "No formatting issues detected."
69+
echo "has_diff=false" >> $GITHUB_OUTPUT
70+
fi
71+
72+
- name: Upload patch
73+
id: upload_artifact_step
74+
if: steps.diff.output.has_diff == 'true'
75+
uses: actions/upload-artifact@v7
76+
with:
77+
name: ${{steps.diff.output.patch_file_name}}
78+
path: ${{steps.diff.output.patch_file_name}}
79+
overwrite: true
80+
81+
- name: Notify the artifact URL
82+
if: steps.upload_artifact_step.conclusion == 'success'
83+
uses: thollander/actions-comment-pull-request@v3
84+
with:
85+
message: |
86+
## :octocat: Format/Amalgamation Check Failed
87+
The source code has not been formatted/amalgamated correctly in the commit [${{github.event.pull_request.head.sha}}](https://github.com/${{github.repository}}/commit/${{github.event.pull_request.head.sha}}).
88+
Please download and apply the patch to fix it.
89+
90+
| Name | ${{steps.diff.output.patch_file_name}}.zip |
91+
|:-----|:-----------------------------------------------------|
92+
| ID | ${{steps.upload_artifact_step.outputs.artifact-id}} |
93+
| URL | ${{steps.upload_artifact_step.outputs.artifact-url}} |
94+
comment_tag: notification

.github/workflows/macos.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
JOBS: 2
4040

4141
steps:
42-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@v7
4343

4444
- name: Configure CMake
4545
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DFK_YAML_BUILD_TEST=ON -DFK_YAML_USE_SINGLE_HEADER=${{matrix.single_header}}
@@ -51,20 +51,23 @@ jobs:
5151
working-directory: ${{github.workspace}}/build
5252
run: ctest -C ${{matrix.build_type}} --output-on-failure -j ${{env.JOBS}}
5353

54-
xcode_for_macos13:
54+
xcode_for_macos14:
5555
timeout-minutes: 10
56-
runs-on: macos-13
56+
runs-on: macos-14
5757
strategy:
5858
fail-fast: false
5959
matrix:
60-
xcode: [ '14.1', '14.2', '14.3.1', '15.0.1', '15.1', '15.2' ]
60+
# The macos-14 runner image will contain only Xcode 15.x versions due to support policy changes.
61+
# Xcode 16.x versions are tested with the macos-15 runner image.
62+
# See https://github.com/actions/runner-images/issues/10703 for more details.
63+
xcode: [ '15.0.1', '15.1', '15.2', '15.3', '15.4' ]
6164
build_type: [ Debug, Release ]
6265
env:
6366
DEVELOPER_DIR: /Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer
64-
JOBS: 3
67+
JOBS: 2
6568

6669
steps:
67-
- uses: actions/checkout@v4
70+
- uses: actions/checkout@v7
6871

6972
- name: Configure CMake
7073
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DFK_YAML_BUILD_TEST=ON
@@ -76,23 +79,20 @@ jobs:
7679
working-directory: ${{github.workspace}}/build
7780
run: ctest -C ${{matrix.build_type}} --output-on-failure -j ${{env.JOBS}}
7881

79-
xcode_for_macos14:
82+
xcode_for_macos15:
8083
timeout-minutes: 10
81-
runs-on: macos-14
84+
runs-on: macos-15
8285
strategy:
8386
fail-fast: false
8487
matrix:
85-
# The macos-14 runner image will contain only Xcode 15.x versions due to support policy changes.
86-
# Xcode 16.x versions are tested with the macos-15 runner image.
87-
# See https://github.com/actions/runner-images/issues/10703 for more details.
88-
xcode: [ '15.0.1', '15.1', '15.2', '15.3', '15.4' ]
88+
xcode: [ '16', '16.1', '16.2', '16.3', '16.4', '26.0.1', '26.1.1', '26.2', '26.3' ]
8989
build_type: [ Debug, Release ]
9090
env:
9191
DEVELOPER_DIR: /Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer
9292
JOBS: 2
9393

9494
steps:
95-
- uses: actions/checkout@v4
95+
- uses: actions/checkout@v7
9696

9797
- name: Configure CMake
9898
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DFK_YAML_BUILD_TEST=ON
@@ -104,22 +104,22 @@ jobs:
104104
working-directory: ${{github.workspace}}/build
105105
run: ctest -C ${{matrix.build_type}} --output-on-failure -j ${{env.JOBS}}
106106

107-
xcode_for_macos15:
107+
xcode_for_macos26:
108108
timeout-minutes: 10
109-
runs-on: macos-15
109+
runs-on: macos-26
110110
strategy:
111111
fail-fast: false
112112
matrix:
113113
# The macos-14 runner image will contain only Xcode 16.x versions.
114114
# See https://github.com/actions/runner-images/issues/10703 for more details.
115-
xcode: [ '16', '16.1' ]
115+
xcode: [ '26.0.1', '26.1.1', '26.2', '26.3', '26.4.1', '26.5', '26.6' ]
116116
build_type: [ Debug, Release ]
117117
env:
118118
DEVELOPER_DIR: /Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer
119119
JOBS: 2
120120

121121
steps:
122-
- uses: actions/checkout@v4
122+
- uses: actions/checkout@v7
123123

124124
- name: Configure CMake
125125
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DFK_YAML_BUILD_TEST=ON

.github/workflows/publish_docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828

2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v7
3131

3232
- name: Build examples
3333
run: |
@@ -38,10 +38,10 @@ jobs:
3838
run: make build-docs
3939

4040
- name: Setup Pages
41-
uses: actions/configure-pages@v4
41+
uses: actions/configure-pages@v6
4242

4343
- name: Upload API documents
44-
uses: actions/upload-pages-artifact@v3
44+
uses: actions/upload-pages-artifact@v5
4545
with:
4646
path: ${{github.workspace}}/docs/site
4747

@@ -56,4 +56,4 @@ jobs:
5656
steps:
5757
- name: Deploy to GitHub Pages
5858
id: deployment
59-
uses: actions/deploy-pages@v4
59+
uses: actions/deploy-pages@v5

.github/workflows/release_package.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
single_header: "ON"
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v7
2424

2525
- name: install zip
2626
run: sudo apt-get install zip
@@ -40,13 +40,13 @@ jobs:
4040
zip -r '${{matrix.artifact_name}}.zip' ./${{matrix.artifact_name}}
4141
4242
- name: Upload Artifacts (tgz)
43-
uses: actions/upload-artifact@v4
43+
uses: actions/upload-artifact@v7
4444
with:
4545
name: '${{matrix.artifact_name}}.tgz'
4646
path: '${{github.workspace}}/build/${{matrix.artifact_name}}.tgz'
4747

4848
- name: Upload Artifacts (zip)
49-
uses: actions/upload-artifact@v4
49+
uses: actions/upload-artifact@v7
5050
with:
5151
name: '${{matrix.artifact_name}}.zip'
5252
path: '${{github.workspace}}/build/${{matrix.artifact_name}}.zip'
@@ -56,7 +56,7 @@ jobs:
5656
runs-on: ubuntu-latest
5757

5858
steps:
59-
- uses: actions/checkout@v4
59+
- uses: actions/checkout@v7
6060

6161
- name: install zip
6262
run: sudo apt-get install zip
@@ -71,13 +71,13 @@ jobs:
7171
rm -rf ./fkYAML_min
7272
7373
- name: Upload the minimum archive (tgz)
74-
uses: actions/upload-artifact@v4
74+
uses: actions/upload-artifact@v7
7575
with:
7676
name: fkYAML_min.tgz
7777
path: '${{github.workspace}}/fkYAML_min.tgz'
7878

7979
- name: Upload the minimum archive (zip)
80-
uses: actions/upload-artifact@v4
80+
uses: actions/upload-artifact@v7
8181
with:
8282
name: fkYAML_min.zip
8383
path: '${{github.workspace}}/fkYAML_min.zip'

0 commit comments

Comments
 (0)