-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add basic linting CI
- Loading branch information
Showing
7 changed files
with
85 additions
and
26 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
IndentWidth: 4 | ||
ColumnLimit: 100 | ||
AlignEscapedNewlines: DontAlign | ||
SortIncludes: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AllowShortIfStatementsOnASingleLine: true | ||
AllowShortLoopsOnASingleLine: true |
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,52 @@ | ||
# Copyright 2024 ETH Zurich and University of Bologna. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Author: Sergio Mazzola <[email protected]> | ||
# Author: Moritz Scherer <[email protected]> | ||
|
||
name: lint | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
|
||
lint-license: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Check license | ||
uses: pulp-platform/pulp-actions/lint-license@v2 | ||
with: | ||
license: | | ||
Copyright (\d{4}(-\d{4})?\s)?.* | ||
(Solderpad Hardware License, Version 0.51|Licensed under the Apache License, Version 2.0), see LICENSE for details. | ||
SPDX-License-Identifier: (SHL-0.51|Apache-2.0) | ||
exclude_paths: | | ||
scripts/run_clang_format.py | ||
lint-cxx: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Run Clang-format | ||
uses: DoozyX/[email protected] | ||
with: | ||
extensions: 'c,h,cpp' | ||
clangFormatVersion: 12 | ||
style: > | ||
{ | ||
IndentWidth: 4, | ||
ColumnLimit: 100, | ||
AlignEscapedNewlines: DontAlign, | ||
SortIncludes: false, | ||
AllowShortFunctionsOnASingleLine: None, | ||
AllowShortIfStatementsOnASingleLine: true, | ||
AllowShortLoopsOnASingleLine: true | ||
} |
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
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 |
---|---|---|
|
@@ -4,6 +4,12 @@ | |
# | ||
# Moritz Scherer <[email protected]> | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) | ||
|
||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
add_subdirectory(generic) | ||
|
||
# TODO: Add target-specific test directories |
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 |
---|---|---|
|
@@ -4,27 +4,15 @@ | |
# | ||
# Moritz Scherer <[email protected]> | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
|
||
set(CMAKE_C_COMPILER_WORKS 1) | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) | ||
|
||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/toolchain_gcc.cmake) | ||
|
||
project(chimera-sdk-test-build LANGUAGES C ASM) | ||
project(chimera-sdk-testReturnZero LANGUAGES C ASM) | ||
|
||
file(GLOB_RECURSE TEST_SRCS | ||
"src/testReturn0.c" | ||
) | ||
|
||
add_chimera_test( | ||
return0 | ||
testReturnZero | ||
${TEST_SRCS} | ||
) | ||
|
||
target_link_libraries(return0 PUBLIC chimera-sdk) | ||
target_link_libraries(testReturnZero PUBLIC chimera-sdk) |
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 |
---|---|---|
|
@@ -4,4 +4,6 @@ | |
// | ||
// Moritz Scherer <[email protected]> | ||
|
||
int main() { return 0; } | ||
int main() { | ||
return 0; | ||
} |