Skip to content

Commit

Permalink
Merge branch 'master' into 14-single-package-analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
Kretchen001 committed Jan 23, 2024
2 parents 0b8b1d1 + 1f345c2 commit 352bdb5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build and test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
paths:
- '**.cs'
- '**.csproj'

env:
DOTNET_VERSION: '8.0.101' # The .NET SDK version to use
SLN_NAME: AmIVulnerable.sln

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: cd & Install dependencies
run: |
cd code/AmIVulnerable
dotnet restore ${{ env.SLN_NAME }}
- name: Build
run: |
cd code/AmIVulnerable
dotnet build ${{ env.SLN_NAME }} --configuration Release --no-restore
- name: Test
run: |
cd code/AmIVulnerable
dotnet test ${{ env.SLN_NAME }} --no-restore --verbosity normal
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ public ConvertCveToDbController(List<string> 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));
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<CVEcomp> col = db.GetCollection<CVEcomp>(tableName);

CVEcomp cve = JsonConvert.DeserializeObject<CVEcomp>(File.ReadAllText(file))!;
Expand Down

0 comments on commit 352bdb5

Please sign in to comment.