-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve local and CI flows #26
Closed
+1,367
−142
Closed
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2f2429c
Improve local and CI flows
neatudarius 55b0b0e
Try to enable clang-19 on CI
neatudarius 51ef125
Add CI linters
neatudarius 981fa33
Add CI badge in README.md
neatudarius ad2a28b
Temporary switch to --config RelWithDebInfo
neatudarius 5bec2bd
Removed old and unused toolchains
neatudarius 70b255c
Add --std parameter for scripts and CI
neatudarius 31d0d7d
Fix .clang-format for clang-19
neatudarius 822bcff
Add temporary broken linted files
neatudarius 4407559
Update .shellcheckrc
neatudarius 8e81632
Remove unused function from lint.sh
neatudarius d1225ca
Update .markdownlint.json
neatudarius 79c6c4b
Update cmake-format.yaml
neatudarius e810962
Add license to linters config file
neatudarius 76a35ce
Fix license in cmake files
neatudarius 680a354
Add docs for installing scripts/run-tests.sh dependencies
neatudarius ffb2e3e
Typo in clang-format arguments
neatudarius 97a7187
Move from .markdownlint.json to .markdownlint.yml
neatudarius 7e5ca22
Tweaks for configs
neatudarius d12cd07
Revert change in .clang-format
neatudarius 2cffd23
Allow --fix anywhere
neatudarius b043a99
Merge branch 'main' into improve-flows
neatudarius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# /.cmake-format.yml -*-config-*- | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
# Default configuration for cmake-format. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
name: CI Lint | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
jobs: | ||
build: | ||
name: ${{ matrix.config.name }} | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {name: "Lint Cpp", os: ubuntu-24.04} | ||
- {name: "Lint Shell", os: ubuntu-24.04} | ||
- {name: "Lint Markdown", os: ubuntu-24.04} | ||
- {name: "Lint YAML", os: ubuntu-24.04} | ||
- {name: "Lint Cmake", os: ubuntu-24.04} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Activate verbose shell | ||
run: set -x | ||
- name: Install Cpp linter | ||
if: startsWith(matrix.config.name, 'Lint Cpp') | ||
run: | | ||
set -x | ||
cat /etc/lsb-release | ||
installed_clang_version=18 | ||
sudo apt-get remove clang-${installed_clang_version} \ | ||
lldb-${installed_clang_version} \ | ||
lld-${installed_clang_version} \ | ||
clangd-${installed_clang_version} \ | ||
clang-tidy-${installed_clang_version} \ | ||
clang-format-${installed_clang_version} \ | ||
clang-tools-${installed_clang_version} \ | ||
llvm-${installed_clang_version}-dev \ | ||
lld-${installed_clang_version} \ | ||
lldb-${installed_clang_version} \ | ||
llvm-${installed_clang_version}-tools \ | ||
libomp-${installed_clang_version}-dev \ | ||
libc++-${installed_clang_version}-dev \ | ||
libc++abi-${installed_clang_version}-dev \ | ||
libclang-common-${installed_clang_version}-dev \ | ||
libclang-${installed_clang_version}-dev \ | ||
libclang-cpp${installed_clang_version}-dev \ | ||
libunwind-${installed_clang_version}-dev | ||
wget https://apt.llvm.org/llvm.sh | ||
chmod +x llvm.sh | ||
sudo ./llvm.sh 19 all | ||
sudo apt-get install libc++-dev libc++1 libc++abi-dev libc++abi1 | ||
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-19 10 | ||
- name: Check Cpp linter | ||
if: startsWith(matrix.config.name, 'Lint Cpp') | ||
run: | | ||
clang-format --version | ||
- name: Run Cpp linter | ||
if: startsWith(matrix.config.name, 'Lint Cpp') | ||
run: | | ||
scripts/lint.sh --verbose --cpp | ||
- name: Install Shell linter | ||
if: startsWith(matrix.config.name, 'Lint Shell') | ||
run: | | ||
sudo apt-get update &> /dev/null | ||
sudo apt-get install shellcheck | ||
- name: Check Shell linter | ||
if: startsWith(matrix.config.name, 'Lint Shell') | ||
run: | | ||
shellcheck --version | ||
- name: Run Shell linter | ||
if: startsWith(matrix.config.name, 'Lint Shell') | ||
run: | | ||
scripts/lint.sh --verbose --shell | ||
- name: Install Markdown linter | ||
if: startsWith(matrix.config.name, 'Lint Markdown') | ||
run: | | ||
sudo apt-get update &> /dev/null | ||
sudo apt-get install -y npm | ||
sudo npm install -g markdownlint-cli | ||
- name: Check Markdown linter | ||
if: startsWith(matrix.config.name, 'Lint Markdown') | ||
run: | | ||
markdownlint --version | ||
- name: Run Markdown linter | ||
if: startsWith(matrix.config.name, 'Lint Markdown') | ||
run: | | ||
scripts/lint.sh --verbose --markdown | ||
- name: Install Yaml linter | ||
if: startsWith(matrix.config.name, 'Lint YAML') | ||
run: | | ||
sudo apt-get update &> /dev/null | ||
sudo apt-get install -y yamllint | ||
- name: Check Yaml linter | ||
if: startsWith(matrix.config.name, 'Lint YAML') | ||
run: | | ||
yamllint --version | ||
- name: Run Yaml linter | ||
if: startsWith(matrix.config.name, 'Lint YAML') | ||
run: | | ||
scripts/lint.sh --verbose --yaml | ||
- name: Install Cmake linter | ||
if: startsWith(matrix.config.name, 'Lint Cmake') | ||
run: | | ||
sudo apt-get update &> /dev/null | ||
sudo apt-get install -y cmake-format | ||
- name: Check Cmake linter | ||
if: startsWith(matrix.config.name, 'Lint Cmake') | ||
run: | | ||
cmake-format --version | ||
- name: Run Cmake linter | ||
if: startsWith(matrix.config.name, 'Lint Cmake') | ||
run: | | ||
scripts/lint.sh --verbose --cmake | ||
|
||
|
||
|
||
|
||
Check failure on line 117 in .github/workflows/ci_lint.yml
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: CI Tests | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
jobs: | ||
build: | ||
name: ${{ matrix.config.name }} | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {name: "Ubuntu Clang 19|C++20", os: ubuntu-24.04, toolchain: clang-19, std: 20, cmake_config: RelWithDebInfo, clang_version: 19, installed_clang_version: 18} | ||
- {name: "Ubuntu Clang 19|C++23", os: ubuntu-24.04, toolchain: clang-19, std: 23, cmake_config: RelWithDebInfo, clang_version: 19, installed_clang_version: 18} | ||
- {name: "Ubuntu Clang 19|C++26", os: ubuntu-24.04, toolchain: clang-19, std: 26, cmake_config: RelWithDebInfo, clang_version: 19, installed_clang_version: 18} | ||
|
||
|
||
- {name: "Ubuntu Clang 18|C++20", os: ubuntu-24.04, toolchain: clang-18, std: 20, cmake_config: Asan, clang_version: 18, installed_clang_version: 18} | ||
- {name: "Ubuntu Clang 18|C++23", os: ubuntu-24.04, toolchain: clang-18, std: 23, cmake_config: Asan, clang_version: 18, installed_clang_version: 18} | ||
- {name: "Ubuntu Clang 18|C++26", os: ubuntu-24.04, toolchain: clang-18, std: 26, cmake_config: Asan, clang_version: 18, installed_clang_version: 18} | ||
|
||
- {name: "Ubuntu Clang 17|C++20", os: ubuntu-24.04, toolchain: clang-17, std: 20, cmake_config: Asan, clang_version: 17, installed_clang_version: 18} | ||
- {name: "Ubuntu Clang 17|C++23", os: ubuntu-24.04, toolchain: clang-17, std: 23, cmake_config: Asan, clang_version: 17, installed_clang_version: 18} | ||
- {name: "Ubuntu Clang 17|C++26", os: ubuntu-24.04, toolchain: clang-17, std: 26, cmake_config: Asan, clang_version: 17, installed_clang_version: 18} | ||
|
||
|
||
- {name: "Ubuntu GCC 14|C++20", os: ubuntu-24.04, toolchain: gcc-14, std: 20, cmake_config: Asan, clang_version: -1, installed_clang_version: -1} | ||
- {name: "Ubuntu GCC 14|C++23", os: ubuntu-24.04, toolchain: gcc-14, std: 23, cmake_config: Asan, clang_version: -1, installed_clang_version: -1} | ||
- {name: "Ubuntu GCC 14|C++26", os: ubuntu-24.04, toolchain: gcc-14, std: 26, cmake_config: Asan, clang_version: -1, installed_clang_version: -1} | ||
|
||
- {name: "Ubuntu GCC 13|C++20", os: ubuntu-24.04, toolchain: gcc-13, std: 20, cmake_config: Asan, clang_version: -1, installed_clang_version: -1} | ||
- {name: "Ubuntu GCC 13|C++23", os: ubuntu-24.04, toolchain: gcc-13, std: 23, cmake_config: Asan, clang_version: -1, installed_clang_version: -1} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- uses: seanmiddleditch/gha-setup-ninja@master | ||
- name: Activate verbose shell | ||
run: set -x | ||
- name: Install LLVM+Clang | ||
if: startsWith(matrix.config.name, 'Ubuntu Clang') | ||
run: | | ||
set -x | ||
cat /etc/lsb-release | ||
sudo apt-get remove clang-${{matrix.config.installed_clang_version}} \ | ||
lldb-${{matrix.config.installed_clang_version}} \ | ||
lld-${{matrix.config.installed_clang_version}} \ | ||
clangd-${{matrix.config.installed_clang_version}} \ | ||
clang-tidy-${{matrix.config.installed_clang_version}} \ | ||
clang-format-${{matrix.config.installed_clang_version}} \ | ||
clang-tools-${{matrix.config.installed_clang_version}} \ | ||
llvm-${{matrix.config.installed_clang_version}}-dev \ | ||
lld-${{matrix.config.installed_clang_version}} \ | ||
lldb-${{matrix.config.installed_clang_version}} \ | ||
llvm-${{matrix.config.installed_clang_version}}-tools \ | ||
libomp-${{matrix.config.installed_clang_version}}-dev \ | ||
libc++-${{matrix.config.installed_clang_version}}-dev \ | ||
libc++abi-${{matrix.config.installed_clang_version}}-dev \ | ||
libclang-common-${{matrix.config.installed_clang_version}}-dev \ | ||
libclang-${{matrix.config.installed_clang_version}}-dev \ | ||
libclang-cpp${{matrix.config.installed_clang_version}}-dev \ | ||
libunwind-${{matrix.config.installed_clang_version}}-dev | ||
wget https://apt.llvm.org/llvm.sh | ||
chmod +x llvm.sh | ||
sudo ./llvm.sh ${{matrix.config.clang_version}} all | ||
sudo apt-get install libc++-dev libc++1 libc++abi-dev libc++abi1 | ||
- name: Install GCC | ||
if: startsWith(matrix.config.name, 'Ubuntu GCC') | ||
run: | | ||
set -x | ||
cat /etc/lsb-release | ||
sudo apt update | ||
sudo apt-get install ${{matrix.config.toolchain}} | ||
- name: Run tests | ||
run: | | ||
set -x | ||
pwd | ||
scripts/run-tests.sh --verbose --fresh --config ${{matrix.config.cmake_config}} --preset ${{matrix.config.toolchain}} --std ${{matrix.config.std}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
// /.markdownlint.json -*-config-*- | ||
neatudarius marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
// Default configuration for markdownlint. | ||
// Check https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md | ||
|
||
{ | ||
// MD013: Line length | ||
"MD013": false, | ||
// MD024: Multiple headers with the same content | ||
"MD024": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# shellcheck | ||
# allow for non-alphanumeric filenames | ||
# /.shellcheckrcc -*-config-*- | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
# Default configuration for shellcheck | ||
|
||
|
||
# allow for non-alphanumeric filenames (https://www.shellcheck.net/wiki/SC2038) | ||
disable=SC2038 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# /.yamllint -*-config-*- | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
# Default configuration for yamllint. | ||
|
||
yaml-files: | ||
- '*.yaml' | ||
- '*.yml' | ||
- '.yamllint' | ||
|
||
rules: | ||
anchors: enable | ||
braces: enable | ||
brackets: enable | ||
colons: enable | ||
commas: enable | ||
comments: | ||
level: warning | ||
comments-indentation: | ||
level: warning | ||
document-end: disable | ||
document-start: disable | ||
empty-lines: enable | ||
empty-values: disable | ||
float-values: disable | ||
hyphens: enable | ||
indentation: enable | ||
key-duplicates: enable | ||
key-ordering: disable | ||
line-length: disable | ||
new-line-at-end-of-file: enable | ||
new-lines: enable | ||
octal-values: disable | ||
quoted-strings: disable | ||
trailing-spaces: enable | ||
truthy: disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make it slightly harder to keep the .clang-format up to date because clang-format will want to rewrite it when you dump the config.
I believe it's right now at clang-format-17.
will produce the file that clang-format believes it read, adding the options that were defaulted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK to remove this file, but wouldn't be consistent for other linters? I think I would like to change it manually (using --dump-config into a temporary file). What do you think?
btw, I tried with clang 17/18/19, and I cannot get the current config. Would you like to update it with clang-format-19 in this PR? (The required changes will be applied in later commits or in a new PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the comment itself that gets lost.
clang-format
configs are generally one way upgradable but otherwise stable. That is, clang-format-N+1 will read an N file and default the elements that are added, so that when you run dump-config you get a file that only cf-N+1 understands but that produces the same output as the old config.Caveats around syntax that clang-format didn't used to understand, of course.
We don't need to be eager about upgrading unless we decide we need the new knobs.
I've left myself a TODO to see if clang-format changes matter for the few files we have, and if so, we probably don't need to upgrade.
It's just that the comments are easy to get lost, and I wouldn't want anyone to read too much into that.