Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
workflow_dispatch:
pull_request:
branches:
- 'main'
- 'feature*'
- 'dev'
paths:
- '*.cs'
- '*.csproj'
- '*.sln'
- 'appsettings.json'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
dotnet-build:
strategy:
fail-fast: false
matrix:
include:
- { dotnet: "8.0.x", os: "ubuntu-latest", configuration: Debug }
- { dotnet: "8.0.x", os: "ubuntu-latest", configuration: Release }
runs-on: ${{ matrix.os }}
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.dotnet}}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Display dotnet version
run: dotnet --version
- name: Build dotnet solution
run: dotnet build KernelMemory.sln -c ${{ matrix.configuration }} /warnaserror
50 changes: 50 additions & 0 deletions .github/workflows/dotnet-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Unit Tests

on:
workflow_dispatch:
pull_request:
branches:
- 'main'
- 'feature*'
- 'dev'
paths:
- '*.cs'
- '*.csproj'
- '*.sln'
- 'appsettings.json'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
dotnet-test:
strategy:
fail-fast: false
matrix:
include:
- { dotnet: "8.0.x", os: "ubuntu-latest" }
- { dotnet: "8.0.x", os: "windows" }
runs-on: ${{ matrix.os }}
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Display dotnet version
run: dotnet --version
- name: Build dotnet solution
run: dotnet build KernelMemory.sln -c Debug --nologo
- name: Run Unit Tests
run: dotnet test KernelMemory.sln -c Debug --filter Category=UnitTest -v q -l html --results-directory "TestResults-${{ matrix.os }}-${{ matrix.dotnet }}" --nologo --no-build
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: dotnet-results-${{ matrix.os }}-${{ matrix.dotnet }}
path: TestResults-${{ matrix.os }}-${{ matrix.dotnet }}
if: ${{ always() }}
2 changes: 2 additions & 0 deletions KernelMemory.sln
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\docker-build-push.yml = .github\workflows\docker-build-push.yml
.github\workflows\github-pages-jekyll.yml = .github\workflows\github-pages-jekyll.yml
.github\workflows\spell-check-with-typos.yml = .github\workflows\spell-check-with-typos.yml
.github\workflows\dotnet-unit-tests.yml = .github\workflows\dotnet-unit-tests.yml
.github\workflows\dotnet-build.yml = .github\workflows\dotnet-build.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "service", "service", "{87DEAE8D-138C-4FDD-B4C9-11C3A7817E8F}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ public async Task ItExtractsAllTypes()
Assert.Contains("\"444666\"", content); // currency
Assert.Contains("\"United States of America\"", content); // text
Assert.Contains("\"Rome\", \"\", \"Tokyo\"", content); // text with empty columns
Assert.Contains("\"1/12/2009\"", content); // date
Assert.Contains("\"12/25/2090\"", content); // date
Assert.Contains("\"98001\"", content); // zip code
Assert.Contains("\"15554000600\"", content); // phone number
Assert.Contains("\"TRUE\"", content); // boolean
Assert.True(content.Contains("\"1/12/2009\"") || content.Contains("\"01/12/2009\""), // date
$"{content} doesn't match one of the expected formats");
}
}