From 1415f2955b00143acbb5c318eb28bf3050618e19 Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:16:52 +0100 Subject: [PATCH 01/13] added pipeline yml --- .../Controller/ConvertCveToDbController.cs | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/code/AmIVulnerable/LiteDbLib/Controller/ConvertCveToDbController.cs b/code/AmIVulnerable/LiteDbLib/Controller/ConvertCveToDbController.cs index 1658127..bdbc842 100644 --- a/code/AmIVulnerable/LiteDbLib/Controller/ConvertCveToDbController.cs +++ b/code/AmIVulnerable/LiteDbLib/Controller/ConvertCveToDbController.cs @@ -56,16 +56,21 @@ public ConvertCveToDbController(List files) { dbFiles = dbFiles.Order().ToList(); //.Distinct() because of line 45 not neccessary } - public bool ConvertRawCve() { - try { - foreach (string file in files) { + public bool ConvertRawCve() + { + try + { + foreach (string file in files) + { + Console.WriteLine(file); Match match = regexYear.Match(file); int dbFile = dbFiles.FindIndex(x => x.Equals(match.Groups[1].Value)); - dbFile = -1; - if (dbFile == -1) { + if (dbFile == -1) + { continue; // if year was not found, continue convert and ignore file } - using (LiteDatabase db = new LiteDatabase($"{saveDir}\\{dbFiles[dbFile]}.litedb")) { + using (LiteDatabase db = new LiteDatabase($"{saveDir}\\{dbFiles[dbFile]}.litedb")) + { ILiteCollection col = db.GetCollection(tableName); CVEcomp cve = JsonConvert.DeserializeObject(File.ReadAllText(file))!; @@ -75,7 +80,8 @@ public bool ConvertRawCve() { } return true; } - catch { + catch + { return false; } } From 4d6b9b2532c8ea6afc43fff53117b087282d03b8 Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:20:29 +0100 Subject: [PATCH 02/13] added pipeline yml (now for sure) --- .github/workflows/build-and-test.yml | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/build-and-test.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..ecc83ec --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,37 @@ +name: build and test + +on: + push: + pull_request: + # branches: [ master ] + paths: + - '**.cs' + - '**.csproj' + +env: + DOTNET_VERSION: '8.0.0' # The .NET SDK version to use + +jobs: + build-and-test: + + name: build-and-test-${{matrix.os}} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test --no-restore --verbosity normal \ No newline at end of file From 34053d1436ba463e6e1a4756ad7769848ee82f1a Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:25:36 +0100 Subject: [PATCH 03/13] try 2 --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ecc83ec..30012bd 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -9,7 +9,7 @@ on: - '**.csproj' env: - DOTNET_VERSION: '8.0.0' # The .NET SDK version to use + DOTNET_VERSION: '8.0.1' # The .NET SDK version to use jobs: build-and-test: From 1f7396b71d358fad054f61215fce2615990f5c09 Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:28:35 +0100 Subject: [PATCH 04/13] try 3 --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 30012bd..388d859 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -9,7 +9,7 @@ on: - '**.csproj' env: - DOTNET_VERSION: '8.0.1' # The .NET SDK version to use + DOTNET_VERSION: '8.0.100' # The .NET SDK version to use jobs: build-and-test: From a0bd349b23756c787e8825baae8f51dba945ec8e Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:31:12 +0100 Subject: [PATCH 05/13] try 4 --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 388d859..bb17e10 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -9,7 +9,7 @@ on: - '**.csproj' env: - DOTNET_VERSION: '8.0.100' # The .NET SDK version to use + DOTNET_VERSION: '8.0.000' # The .NET SDK version to use jobs: build-and-test: From 25d862936a7a12b5468862b80b8f22da6e6d2529 Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:33:06 +0100 Subject: [PATCH 06/13] try 5 --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index bb17e10..38498e1 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -9,7 +9,7 @@ on: - '**.csproj' env: - DOTNET_VERSION: '8.0.000' # The .NET SDK version to use + DOTNET_VERSION: '8.0.101' # The .NET SDK version to use jobs: build-and-test: From f51e979837d7fe91e79b5f596e7e77244b73eadb Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:36:01 +0100 Subject: [PATCH 07/13] try 6 --- .github/workflows/build-and-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 38498e1..62ebf49 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -28,6 +28,7 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Install dependencies + before-run: cd code/AmIVulnerable run: dotnet restore - name: Build From db549d9a8d37b7a48b8a64f72c294865eb07bd70 Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:37:18 +0100 Subject: [PATCH 08/13] try 7 --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 62ebf49..d38d179 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -28,7 +28,7 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Install dependencies - before-run: cd code/AmIVulnerable + run: cd code/AmIVulnerable run: dotnet restore - name: Build From 908e417821995c81c38f0b40040c9ceb87ef7c7a Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:38:27 +0100 Subject: [PATCH 09/13] try 8 --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d38d179..37f8ee6 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -29,7 +29,7 @@ jobs: - name: Install dependencies run: cd code/AmIVulnerable - run: dotnet restore + dotnet restore - name: Build run: dotnet build --configuration Release --no-restore From b0467473763435e7f6081ce598e1e3f1231f1bc5 Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:40:06 +0100 Subject: [PATCH 10/13] try 9 --- .github/workflows/build-and-test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 37f8ee6..d9b93a9 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -27,9 +27,10 @@ jobs: with: dotnet-version: ${{ env.DOTNET_VERSION }} - - name: Install dependencies - run: cd code/AmIVulnerable - dotnet restore + - name: cd & Install dependencies + run: | + cd code/AmIVulnerable + dotnet restore - name: Build run: dotnet build --configuration Release --no-restore From 67b6592073e9632f55ef211011e5a843054d26b8 Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:42:28 +0100 Subject: [PATCH 11/13] try 10 --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d9b93a9..fa4db5d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -30,7 +30,7 @@ jobs: - name: cd & Install dependencies run: | cd code/AmIVulnerable - dotnet restore + dotnet restore AmIVulnerable.sln - name: Build run: dotnet build --configuration Release --no-restore From 7fc67c259470ff981190e8b8b66b931dba059d4c Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:45:14 +0100 Subject: [PATCH 12/13] try 10 --- .github/workflows/build-and-test.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index fa4db5d..024fb73 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -10,6 +10,7 @@ on: env: DOTNET_VERSION: '8.0.101' # The .NET SDK version to use + SLN_NAME: AmIVulnerable.sln jobs: build-and-test: @@ -30,10 +31,14 @@ jobs: - name: cd & Install dependencies run: | cd code/AmIVulnerable - dotnet restore AmIVulnerable.sln + dotnet restore ${{ env.SLN_NAME }} - name: Build - run: dotnet build --configuration Release --no-restore + run: | + cd code/AmIVulnerable + dotnet build ${{ env.SLN_NAME }} --configuration Release --no-restore - name: Test - run: dotnet test --no-restore --verbosity normal \ No newline at end of file + run: | + cd code/AmIVulnerable + dotnet test ${{ env.SLN_NAME }} --no-restore --verbosity normal \ No newline at end of file From 35af834a8004980355337da866c1173652fa8bc1 Mon Sep 17 00:00:00 2001 From: KnYL3R Date: Tue, 23 Jan 2024 15:51:15 +0100 Subject: [PATCH 13/13] final pipeline change --- .github/workflows/build-and-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 024fb73..b2336c2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -2,8 +2,9 @@ name: build and test on: push: + branches: [ master ] pull_request: - # branches: [ master ] + branches: [ master ] paths: - '**.cs' - '**.csproj'