From ccf9a30e8cdc1fe70594ef05bd63c81835344ef6 Mon Sep 17 00:00:00 2001 From: Jaeyong Sung Date: Sun, 23 Jan 2022 18:58:19 +0900 Subject: [PATCH 1/4] change to rust --- Cargo.toml | 2 +- client/.clang-format | 93 ------------------------------------- client/Cargo.toml | 8 ++++ client/Includes/Server.hpp | 6 --- client/Sources/Server.cpp | 6 --- client/Tests/SimpleTest.cpp | 9 ---- client/src/main.rs | 3 ++ 7 files changed, 12 insertions(+), 115 deletions(-) delete mode 100644 client/.clang-format create mode 100644 client/Cargo.toml delete mode 100644 client/Includes/Server.hpp delete mode 100644 client/Sources/Server.cpp delete mode 100644 client/Tests/SimpleTest.cpp create mode 100644 client/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index cae9660..3bb975a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,2 +1,2 @@ [workspace] -members = ["server"] +members = ["server", "client"] diff --git a/client/.clang-format b/client/.clang-format deleted file mode 100644 index a02bad1..0000000 --- a/client/.clang-format +++ /dev/null @@ -1,93 +0,0 @@ ---- -Language: Cpp -# BasedOnStyle: Google -AccessModifierOffset: -3 -AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: false -AlignConsecutiveDeclarations: false -AlignEscapedNewlinesLeft: true -AlignOperands: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: true -AlwaysBreakTemplateDeclarations: true -BinPackArguments: true -BinPackParameters: true -BreakBeforeBraces: Custom -BraceWrapping: - AfterClass: true - AfterControlStatement: true - AfterEnum: true - AfterFunction: true - AfterNamespace: true - AfterObjCDeclaration: true - AfterStruct: true - AfterUnion: true - BeforeCatch: true - BeforeElse: true - IndentBraces: false -BreakBeforeBinaryOperators: None -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BreakAfterJavaFieldAnnotations: false -BreakStringLiterals: true -ColumnLimit: 80 -CommentPragmas: '^ IWYU pragma:' -ConstructorInitializerAllOnOneLineOrOnePerLine: true -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 4 -Cpp11BracedListStyle: false -DerivePointerAlignment: true -DisableFormat: false -ExperimentalAutoDetectBinPacking: false -ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] -IncludeCategories: - - Regex: '^<.*\.h>' - Priority: 1 - - Regex: '^<.*' - Priority: 2 - - Regex: '.*' - Priority: 3 -IncludeIsMainRegex: '([-_](test|unittest))?$' -IndentCaseLabels: true -IndentWidth: 4 -IndentWrappedFunctionNames: false -JavaScriptQuotes: Leave -JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: false -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCBlockIndentWidth: 2 -ObjCSpaceAfterProperty: false -ObjCSpaceBeforeProtocolList: false -PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 300 -PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 200 -PointerAlignment: Left -ReflowComments: true -SortIncludes: true -SpaceAfterCStyleCast: false -SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: ControlStatements -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 2 -SpacesInAngles: false -SpacesInContainerLiterals: true -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false -SpacesInSquareBrackets: false -Standard: Auto -TabWidth: 4 -UseTab: Never \ No newline at end of file diff --git a/client/Cargo.toml b/client/Cargo.toml new file mode 100644 index 0000000..729587b --- /dev/null +++ b/client/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "client" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/client/Includes/Server.hpp b/client/Includes/Server.hpp deleted file mode 100644 index c15e2f4..0000000 --- a/client/Includes/Server.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef CUBBY_CONNECT_CLIENT_SERVER_HPP -#define CUBBY_CONNECT_CLIENT_SERVER_HPP - -int Add(int a, int b); - -#endif \ No newline at end of file diff --git a/client/Sources/Server.cpp b/client/Sources/Server.cpp deleted file mode 100644 index 8877032..0000000 --- a/client/Sources/Server.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int Add(int a, int b) -{ - return a + b; -} \ No newline at end of file diff --git a/client/Tests/SimpleTest.cpp b/client/Tests/SimpleTest.cpp deleted file mode 100644 index 9854713..0000000 --- a/client/Tests/SimpleTest.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN -#include "doctest.h" - -#include - -TEST_CASE("Simple test") -{ - CHECK(Add(2, 3) == 5); -} \ No newline at end of file diff --git a/client/src/main.rs b/client/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/client/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} From 8450e438340301981adcf0191b4f1ae3a5861e20 Mon Sep 17 00:00:00 2001 From: Jaeyong Sung Date: Sun, 23 Jan 2022 18:58:44 +0900 Subject: [PATCH 2/4] change to library --- client/src/lib.rs | 1 + client/src/main.rs | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) create mode 100644 client/src/lib.rs delete mode 100644 client/src/main.rs diff --git a/client/src/lib.rs b/client/src/lib.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/client/src/lib.rs @@ -0,0 +1 @@ + diff --git a/client/src/main.rs b/client/src/main.rs deleted file mode 100644 index e7a11a9..0000000 --- a/client/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, world!"); -} From 7ba18f1469143b57811268d0af84e5c09f6e1962 Mon Sep 17 00:00:00 2001 From: Jaeyong Sung Date: Sun, 13 Mar 2022 01:02:15 +0900 Subject: [PATCH 3/4] add client CI --- .github/workflows/{server-audit.yml => audit.yml} | 0 .github/workflows/{server-build.yml => build.yml} | 6 ++++++ .github/workflows/{server-clippy.yml => clippy.yml} | 6 ++++++ .github/workflows/{server-coverage.yml => coverage.yml} | 2 +- .github/workflows/{server-fmt.yml => fmt.yml} | 0 .github/workflows/{server-test.yml => test.yml} | 6 ++++++ 6 files changed, 19 insertions(+), 1 deletion(-) rename .github/workflows/{server-audit.yml => audit.yml} (100%) rename .github/workflows/{server-build.yml => build.yml} (89%) rename .github/workflows/{server-clippy.yml => clippy.yml} (88%) rename .github/workflows/{server-coverage.yml => coverage.yml} (94%) rename .github/workflows/{server-fmt.yml => fmt.yml} (100%) rename .github/workflows/{server-test.yml => test.yml} (89%) diff --git a/.github/workflows/server-audit.yml b/.github/workflows/audit.yml similarity index 100% rename from .github/workflows/server-audit.yml rename to .github/workflows/audit.yml diff --git a/.github/workflows/server-build.yml b/.github/workflows/build.yml similarity index 89% rename from .github/workflows/server-build.yml rename to .github/workflows/build.yml index f2ac753..b677c9c 100644 --- a/.github/workflows/server-build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,12 @@ jobs: toolchain: ${{ matrix.rust }} override: true + - name: build client (default feature) + uses: actions-rs/cargo@v1 + with: + command: build + args: --all-targets --manifest-path client/Cargo.toml + - name: build server (default feature) uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/server-clippy.yml b/.github/workflows/clippy.yml similarity index 88% rename from .github/workflows/server-clippy.yml rename to .github/workflows/clippy.yml index 822b9b1..055bc54 100644 --- a/.github/workflows/server-clippy.yml +++ b/.github/workflows/clippy.yml @@ -35,6 +35,12 @@ jobs: override: true components: clippy + - name: clippy client (default feature) + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all-targets --manifest-path client/Cargo.toml -- -D warnings + - name: clippy server (default feature) uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/server-coverage.yml b/.github/workflows/coverage.yml similarity index 94% rename from .github/workflows/server-coverage.yml rename to .github/workflows/coverage.yml index 89737ae..042223e 100644 --- a/.github/workflows/server-coverage.yml +++ b/.github/workflows/coverage.yml @@ -23,7 +23,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --all-features --no-fail-fast --manifest-path server/Cargo.toml + args: --all-features --no-fail-fast --manifest-path Cargo.toml env: CARGO_INCREMENTAL: '0' RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' diff --git a/.github/workflows/server-fmt.yml b/.github/workflows/fmt.yml similarity index 100% rename from .github/workflows/server-fmt.yml rename to .github/workflows/fmt.yml diff --git a/.github/workflows/server-test.yml b/.github/workflows/test.yml similarity index 89% rename from .github/workflows/server-test.yml rename to .github/workflows/test.yml index 269aad1..4ffece3 100644 --- a/.github/workflows/server-test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,12 @@ jobs: toolchain: ${{ matrix.rust }} override: true + - name: test client (default feature) + uses: actions-rs/cargo@v1 + with: + command: test + args: --manifest-path client/Cargo.toml + - name: test server (default feature) uses: actions-rs/cargo@v1 with: From f8a625252838c538a4c40f45f261f4e8cb766c9e Mon Sep 17 00:00:00 2001 From: Jaeyong Sung Date: Sun, 13 Mar 2022 01:04:42 +0900 Subject: [PATCH 4/4] change name of CI --- .github/workflows/audit.yml | 4 ++-- .github/workflows/build.yml | 4 ++-- .github/workflows/clippy.yml | 4 ++-- .github/workflows/coverage.yml | 4 ++-- .github/workflows/fmt.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index a3b3eac..f15b659 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,4 +1,4 @@ -name: Server Audit +name: Audit on: push: @@ -7,7 +7,7 @@ on: branches: [ main ] jobs: - server_security_audit: + security_audit: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b677c9c..896d330 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Server Build +name: Build on: push: @@ -7,7 +7,7 @@ on: branches: [ main ] jobs: - server_build: + build: runs-on: ${{ matrix.os }} strategy: diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 055bc54..7ac47b9 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -1,4 +1,4 @@ -name: Server Clippy +name: Clippy on: push: @@ -7,7 +7,7 @@ on: branches: [ main ] jobs: - server_clippy: + clippy: runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 042223e..1c73821 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,4 @@ -name: Server Coverage +name: Coverage on: push: @@ -7,7 +7,7 @@ on: branches: [ main ] jobs: - server_coverage: + coverage: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index 29c4723..1e56161 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -1,4 +1,4 @@ -name: Server Fmt +name: Fmt on: push: @@ -7,7 +7,7 @@ on: branches: [ main ] jobs: - server_fmt: + fmt: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4ffece3..2224d12 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Server Test +name: Test on: push: @@ -7,7 +7,7 @@ on: branches: [ main ] jobs: - server_test: + test: runs-on: ${{ matrix.os }} strategy: