Skip to content

Commit

Permalink
Merge pull request #199 from kevbite/issue_191
Browse files Browse the repository at this point in the history
Move to GitHub actions
  • Loading branch information
kevbite authored Dec 27, 2022
2 parents 442b53d + f2da036 commit 3a32d65
Show file tree
Hide file tree
Showing 180 changed files with 146 additions and 191 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Continuous Integration Workflow

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
env:
VERSION: 7.12.${{ github.run_number }}-preview
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
- name: Docker Build NuGet packages
run: |
docker build --build-arg NUGET_PACKAGE_VERSION=${{ env.VERSION }} --build-arg COMPANIES_HOUSE_API_KEY=${{ secrets.COMPANIES_HOUSE_API_KEY }} -f ./Dockerfile --output ./ .
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
trx_files: TestResults/**/*.trx
- name: NuGet.Org push
if: github.ref == 'refs/heads/master'
run: |
dotnet nuget push ./artifacts/*.nupkg --source NuGet.org --api-key ${{ secrets.NUGET_API_KEY }}
- name: Create Release
id: create_release
if: github.ref == 'refs/heads/master'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body: |
Release ${{ env.VERSION }}
draft: false
prerelease: false
14 changes: 7 additions & 7 deletions src/CompaniesHouse.sln → CompaniesHouse.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30523.141
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompaniesHouse.Tests", "CompaniesHouse.Tests\CompaniesHouse.Tests.csproj", "{BC825074-5662-421D-A849-FD94158F3029}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompaniesHouse.Tests", "tests\CompaniesHouse.Tests\CompaniesHouse.Tests.csproj", "{BC825074-5662-421D-A849-FD94158F3029}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Stuff", "Stuff", "{F0091515-C8D4-490D-ACD8-84A1C0F31E03}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -17,17 +17,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{C8235BA8
..\build-before_build.ps1 = ..\build-before_build.ps1
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompaniesHouse.IntegrationTests", "CompaniesHouse.IntegrationTests\CompaniesHouse.IntegrationTests.csproj", "{6B83B8C2-9DA6-42D5-BB32-BD0C6FDFC14D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompaniesHouse.IntegrationTests", "tests\CompaniesHouse.IntegrationTests\CompaniesHouse.IntegrationTests.csproj", "{6B83B8C2-9DA6-42D5-BB32-BD0C6FDFC14D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompaniesHouse", "CompaniesHouse\CompaniesHouse.csproj", "{9639747A-C49F-42E9-85A4-41FCBFCB7A16}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompaniesHouse", "src\CompaniesHouse\CompaniesHouse.csproj", "{9639747A-C49F-42E9-85A4-41FCBFCB7A16}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompaniesHouse.ScenarioTests", "CompaniesHouse.ScenarioTests\CompaniesHouse.ScenarioTests.csproj", "{E1DA350A-FC73-4999-9B02-CBF8538945C9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompaniesHouse.ScenarioTests", "tests\CompaniesHouse.ScenarioTests\CompaniesHouse.ScenarioTests.csproj", "{E1DA350A-FC73-4999-9B02-CBF8538945C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleProject", "SampleProject\SampleProject.csproj", "{4F078B5D-05F5-4134-9B8F-1AC43BFCFD7E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleProject", "samples\SampleProject\SampleProject.csproj", "{4F078B5D-05F5-4134-9B8F-1AC43BFCFD7E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompaniesHouse.Extensions.Microsoft.DependencyInjection", "CompaniesHouse.Extensions.Microsoft.DependencyInjection\CompaniesHouse.Extensions.Microsoft.DependencyInjection.csproj", "{5C6AC4CD-8E8B-4700-B01B-7B57C74AE791}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompaniesHouse.Extensions.Microsoft.DependencyInjection", "src\CompaniesHouse.Extensions.Microsoft.DependencyInjection\CompaniesHouse.Extensions.Microsoft.DependencyInjection.csproj", "{5C6AC4CD-8E8B-4700-B01B-7B57C74AE791}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompaniesHouse.Extensions.Microsoft.DependencyInjection.Tests", "CompaniesHouse.Extensions.Microsoft.DependencyInjection.Tests\CompaniesHouse.Extensions.Microsoft.DependencyInjection.Tests.csproj", "{011662B7-5E03-4E6A-BAEA-B5C3FE169D3F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompaniesHouse.Extensions.Microsoft.DependencyInjection.Tests", "tests\CompaniesHouse.Extensions.Microsoft.DependencyInjection.Tests\CompaniesHouse.Extensions.Microsoft.DependencyInjection.Tests.csproj", "{011662B7-5E03-4E6A-BAEA-B5C3FE169D3F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
23 changes: 23 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project>
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<PropertyGroup>
<Authors>Kevin Smith</Authors>
<Company>Kevsoft</Company>
<Copyright>Copyright © Kevsoft 2020</Copyright>

<PackageTags>CompaniesHouse;Registrar;Kevsoft;API;REST;WebService</PackageTags>
<PackageIconUrl>https://raw.githubusercontent.com/kevbite/CompaniesHouse.NET/master/companies-house.jpg</PackageIconUrl>
<PackageIcon>companies-house.jpg</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/kevbite/CompaniesHouse.NET</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/kevbite/CompaniesHouse.NET</RepositoryUrl>
</PropertyGroup>
</Project>
2 changes: 2 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
ARG CONFIGURATION="Release"
ARG NUGET_PACKAGE_VERSION="1.0.0"
ARG COMPANIES_HOUSE_API_KEY
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS restore

ARG CONFIGURATION

COPY ./*.props .
COPY ./*.targets .
COPY ./*.sln .
COPY ./*.jpg .
COPY ./README.md .
COPY ./LICENSE .

COPY ./src/CompaniesHouse/*.csproj ./src/CompaniesHouse/
COPY ./src/CompaniesHouse.Extensions.Microsoft.DependencyInjection/*.csproj ./src/CompaniesHouse.Extensions.Microsoft.DependencyInjection/
COPY ./tests/CompaniesHouse.Extensions.Microsoft.DependencyInjection.Tests/*.csproj ./tests/CompaniesHouse.Extensions.Microsoft.DependencyInjection.Tests/
COPY ./tests/CompaniesHouse.IntegrationTests/*.csproj ./tests/CompaniesHouse.IntegrationTests/
COPY ./tests/CompaniesHouse.ScenarioTests/*.csproj ./tests/CompaniesHouse.ScenarioTests/
COPY ./tests/CompaniesHouse.Tests/*.csproj ./tests/CompaniesHouse.Tests/
COPY ./samples/SampleProject/*.csproj ./samples/SampleProject/
RUN dotnet restore

FROM restore as build
ARG CONFIGURATION
ARG NUGET_PACKAGE_VERSION

COPY ./src/ ./src/
COPY ./tests/ ./tests/
COPY ./samples/ ./samples/
RUN dotnet build --configuration $CONFIGURATION --no-restore

FROM build as test
ARG COMPANIES_HOUSE_API_KEY
RUN dotnet test --logger trx --configuration $CONFIGURATION --no-build

FROM build as pack
RUN mkdir -p artifacts
RUN dotnet pack --configuration Release -p:Version=${NUGET_PACKAGE_VERSION} --no-build --output ./artifacts

FROM scratch
COPY --from=pack /artifacts/*.nupkg /artifacts/
COPY --from=pack /artifacts/*.snupkg /artifacts/
COPY --from=test /tests/CompaniesHouse.Extensions.Microsoft.DependencyInjection.Tests/TestResults/*.trx /TestResults/CompaniesHouse.Extensions.Microsoft.DependencyInjection.Tests/
COPY --from=test /tests/CompaniesHouse.IntegrationTests/TestResults/*.trx /TestResults/CompaniesHouse.IntegrationTests/
COPY --from=test /tests/CompaniesHouse.ScenarioTests/TestResults/*.trx /TestResults/CompaniesHouse.ScenarioTests/
COPY --from=test /tests/CompaniesHouse.Tests/TestResults/*.trx /TestResults/CompaniesHouse.Tests/
104 changes: 0 additions & 104 deletions appveyor.yml

This file was deleted.

4 changes: 0 additions & 4 deletions build-before_build.ps1

This file was deleted.

7 changes: 0 additions & 7 deletions environment-install.ps1

This file was deleted.

File renamed without changes.
12 changes: 12 additions & 0 deletions samples/SampleProject/SampleProject.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\CompaniesHouse\CompaniesHouse.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,12 @@
</PropertyGroup>

<PropertyGroup>
<Title>CompaniesHouse.Extensions.Microsoft.DependencyInjection</Title>
<AssemblyName>CompaniesHouse.Extensions.Microsoft.DependencyInjection</AssemblyName>
<PackageId>CompaniesHouse.Extensions.Microsoft.DependencyInjection</PackageId>
<Authors>Kevin Smith</Authors>
<Company>Kevsoft</Company>
<AssemblyTitle>CompaniesHouse.Extensions.Microsoft.DependencyInjection</AssemblyTitle>
<Description>
The CompaniesHouse extensions for ASP.NET Core
</Description>
<Copyright>Copyright © Kevsoft 2020</Copyright>
</PropertyGroup>

<PropertyGroup>
<PackageTags>CompaniesHouse;Registrar;Kevsoft;API;REST;WebService</PackageTags>
<PackageIconUrl>https://raw.githubusercontent.com/kevbite/CompaniesHouse.NET/master/companies-house.jpg</PackageIconUrl>
<PackageIcon>companies-house.jpg</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/kevbite/CompaniesHouse.NET</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/kevbite/CompaniesHouse.NET</RepositoryUrl>
</PropertyGroup>


<ItemGroup>
<None Include="..\..\companies-house.jpg" Pack="true" PackagePath="" />
Expand Down
18 changes: 1 addition & 17 deletions src/CompaniesHouse/CompaniesHouse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,12 @@

<PropertyGroup>
<Title>CompaniesHouse.NET</Title>
<AssemblyName>CompaniesHouse</AssemblyName>
<PackageId>CompaniesHouse</PackageId>
<Authors>Kevin Smith</Authors>
<Company>Kevsoft</Company>
<AssemblyTitle>CompaniesHouse.NET</AssemblyTitle>
<Description>
A simple .NET API client wrapper for CompaniesHouse
</Description>
<Copyright>Copyright © Kevsoft 2020</Copyright>
</PropertyGroup>

<PropertyGroup>
<PackageTags>CompaniesHouse;Registrar;Kevsoft;API;REST;WebService</PackageTags>
<PackageIconUrl>https://raw.githubusercontent.com/kevbite/CompaniesHouse.NET/master/companies-house.jpg</PackageIconUrl>
<PackageIcon>companies-house.jpg</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/kevbite/CompaniesHouse.NET</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/kevbite/CompaniesHouse.NET</RepositoryUrl>
<LangVersion>latest</LangVersion>
</PropertyGroup>


<ItemGroup>
<None Include="..\..\companies-house.jpg" Pack="true" PackagePath="" />
Expand Down
12 changes: 0 additions & 12 deletions src/SampleProject/SampleProject.csproj

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -14,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CompaniesHouse.Extensions.Microsoft.DependencyInjection\CompaniesHouse.Extensions.Microsoft.DependencyInjection.csproj" />
<ProjectReference Include="..\..\src\CompaniesHouse.Extensions.Microsoft.DependencyInjection\CompaniesHouse.Extensions.Microsoft.DependencyInjection.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 3a32d65

Please sign in to comment.