v1.0.0 #186
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request] | |
env: | |
BUILD_CONFIGURATION: Release | |
BUILD_NET_TEST_TARGET: net8.0 | |
BUILD_NETFWK_TEST_TARGET: net48 | |
DOTNET_NOLOGO: 1 | |
jobs: | |
unix: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
matrix: | |
include: | |
- name: Linux x64 | |
runner: ubuntu-latest | |
platform: x64 | |
extension: so | |
- name: macOS arm64 | |
runner: macos-14 | |
platform: arm64 | |
extension: dylib | |
- name: macOS x64 | |
runner: macos-12 | |
platform: x64 | |
extension: dylib | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
5.0.x | |
8.0.x | |
- name: CMake | |
run: | | |
mkdir src/cmake | |
cd src/cmake | |
cmake .. -DCMAKE_BUILD_TYPE=${{ env.BUILD_CONFIGURATION }} | |
- name: Build Native | |
run: | | |
cd src/cmake | |
make | |
- name: Copy Native Lib | |
run: | | |
mkdir lib | |
cp src/cmake/PCRE.NET.Native.${{ matrix.extension }} lib/PCRE.NET.Native.${{ matrix.platform }}.${{ matrix.extension }} | |
- name: Test .NET | |
run: dotnet test src/PCRE.NET.Tests/PCRE.NET.Tests.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --framework ${{ env.BUILD_NET_TEST_TARGET }} -p:PcreNetTestBuild=true -p:ExpectPlatform=${{ matrix.platform }} | |
- name: Test .NET Standard | |
run: dotnet test src/PCRE.NET.Tests/PCRE.NET.Tests.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --framework ${{ env.BUILD_NET_TEST_TARGET }} -p:PcreNetTestBuild=true -p:ExpectPlatform=${{ matrix.platform }} -p:ForceNetStandard=true | |
- name: Test Allocations | |
run: dotnet run --project src/PCRE.NET.Benchmarks/PCRE.NET.Benchmarks.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --framework ${{ env.BUILD_NET_TEST_TARGET }} -- --allocations | |
- name: Upload Native Lib | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lib-${{ matrix.platform }}.${{ matrix.extension }} | |
path: lib/PCRE.NET.Native.${{ matrix.platform }}.${{ matrix.extension }} | |
if-no-files-found: error | |
windows: | |
name: Windows ${{ matrix.platform }} | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
include: | |
- platform: x86 | |
msbuild-platform: Win32 | |
- platform: x64 | |
msbuild-platform: x64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
5.0.x | |
8.0.x | |
- name: Setup VS Dev Tools | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Setup Environment | |
run: | | |
echo 'BUILD_COMMON_MSBUILD_ARGS=/v:m /m /p:Configuration=${{ env.BUILD_CONFIGURATION }}' >> $GITHUB_ENV | |
echo 'Platform=' >> $GITHUB_ENV | |
shell: bash | |
- name: NuGet Restore | |
run: dotnet restore src/PCRE.NET.sln | |
- name: Build Native | |
run: msbuild src/PCRE.NET.Native/PCRE.NET.Native.vcxproj ${{ env.BUILD_COMMON_MSBUILD_ARGS }} /p:Platform=${{ matrix.msbuild-platform }} | |
- name: Build Tests | |
run: msbuild src/PCRE.NET.Tests/PCRE.NET.Tests.csproj ${{ env.BUILD_COMMON_MSBUILD_ARGS }} /p:Platform=${{ matrix.platform }} /p:PcreNetTestBuild=true /p:ExpectPlatform=${{ matrix.platform }} | |
- name: Test .NET Framework | |
run: vstest.console src/PCRE.NET.Tests/bin/${{ matrix.platform }}/${{ env.BUILD_CONFIGURATION }}/${{ env.BUILD_NETFWK_TEST_TARGET }}/PCRE.NET.Tests.dll /Platform:${{ matrix.platform }} | |
- name: Test .NET | |
run: dotnet test src/PCRE.NET.Tests/PCRE.NET.Tests.csproj --configuration ${{ env.BUILD_CONFIGURATION }} -p:PcreNetTestBuild=true -p:ExpectPlatform=${{ matrix.platform }} | |
if: ${{ matrix.platform == 'x64' }} | |
- name: Test .NET Standard | |
run: dotnet test src/PCRE.NET.Tests/PCRE.NET.Tests.csproj --configuration ${{ env.BUILD_CONFIGURATION }} -p:PcreNetTestBuild=true -p:ExpectPlatform=${{ matrix.platform }} -p:ForceNetStandard=true | |
if: ${{ matrix.platform == 'x64' }} | |
- name: Test Allocations .NET | |
run: dotnet run --project src/PCRE.NET.Benchmarks/PCRE.NET.Benchmarks.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --framework ${{ env.BUILD_NET_TEST_TARGET }} -- --allocations | |
if: ${{ matrix.platform == 'x64' }} | |
- name: Test Allocations .NET Framework | |
run: dotnet run --project src/PCRE.NET.Benchmarks/PCRE.NET.Benchmarks.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --framework ${{ env.BUILD_NETFWK_TEST_TARGET }} -- --allocations | |
if: ${{ matrix.platform == 'x64' }} | |
- name: Upload Native Lib | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lib-${{ matrix.platform }}.dll | |
path: lib/PCRE.NET.Native.${{ matrix.platform }}.dll | |
if-no-files-found: error | |
pack: | |
name: Pack | |
runs-on: ubuntu-latest | |
needs: | |
- unix | |
- windows | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
5.0.x | |
8.0.x | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: lib | |
merge-multiple: true | |
- name: Delete Native Lib Artifacts | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: lib-* | |
failOnError: false | |
- name: NuGet Restore | |
run: dotnet restore src/PCRE.NET/PCRE.NET.csproj | |
- name: Build PCRE.NET | |
run: dotnet build --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore src/PCRE.NET/PCRE.NET.csproj -p:PcreNetPackage=true | |
- name: NuGet Pack | |
run: dotnet pack --configuration ${{ env.BUILD_CONFIGURATION }} --no-build src/PCRE.NET/PCRE.NET.csproj -p:PcreNetPackage=true | |
- name: Upload NuGet | |
uses: actions/upload-artifact@v4 | |
with: | |
name: NuGet | |
path: src/PCRE.NET/bin/${{ env.BUILD_CONFIGURATION }}/*.nupkg | |
if-no-files-found: error | |
integration-tests: | |
name: Integration Test ${{ matrix.name }} | |
runs-on: ${{ matrix.runner }} | |
needs: | |
- pack | |
strategy: | |
matrix: | |
include: | |
- name: Linux x64 | |
runner: ubuntu-latest | |
- name: macOS arm64 | |
runner: macos-14 | |
- name: macOS x64 | |
runner: macos-12 | |
- name: Windows x64 | |
runner: windows-2022 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Download NuGet | |
uses: actions/download-artifact@v4 | |
with: | |
name: NuGet | |
path: src/PCRE.NET.Tests.Integration/nuget | |
- name: Integration Test | |
run: dotnet test src/PCRE.NET.Tests.Integration/PCRE.NET.Tests.Integration.csproj -p:PcreNetIntegrationTest=true |