Skip to content

Commit

Permalink
Merge pull request #43 from Ken-Tucker/catch_block_codeql
Browse files Browse the repository at this point in the history
Add tests for dotnet framework
  • Loading branch information
vb2ae authored Nov 25, 2023
2 parents 76f414f + 0331400 commit 6e3f078
Show file tree
Hide file tree
Showing 11 changed files with 2,801 additions and 16 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
runs-on: windows-2022
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
Expand Down Expand Up @@ -63,13 +63,17 @@ jobs:
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Install dependencies
run: msbuild ${{env.solution}} -t:restore
- name: Build
run: msbuild ${{env.caliburn_sln}} /t:Build /p:Configuration=Release

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
nuget_folder: "\\packages"
upload_folder: "AstronomyPictureOfTheDay\\bin\\Release"

solution: "AstronomyPictureOfTheDay.sln"
jobs:
build:

Expand All @@ -25,10 +25,12 @@ jobs:
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Install dependencies
run: dotnet restore
run: msbuild ${{env.solution}} -t:restore
- name: Build
run: dotnet build --configuration Release --no-restore
run: msbuild ${{env.caliburn_sln}} /t:Build /p:Configuration=Release
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{233CABEC-92C5-454D-B3A9-8DCF52636D7C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AstronomyPictureOfTheDay.DotNetFramework.Xunit.Tests</RootNamespace>
<AssemblyName>AstronomyPictureOfTheDay.DotNetFramework.Xunit.Tests</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TestProjectType>UnitTest</TestProjectType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FakeItEasy">
<Version>8.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="System.Net.Http">
<Version>4.3.4</Version>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="coverlet.collector" Version="1.0.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="MarsPictureTests.cs" />
<Compile Include="NasaPictureOfTheDayTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AstronomyPictureOfTheDay\AstronomyPictureOfTheDay.csproj">
<Project>{3eaecd48-cb4d-43a2-97c3-490704e7d473}</Project>
<Name>AstronomyPictureOfTheDay</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="MarsPic.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading

0 comments on commit 6e3f078

Please sign in to comment.