Skip to content

add Akka.Analyzers install canary #323

add Akka.Analyzers install canary

add Akka.Analyzers install canary #323

Workflow file for this run

name: pr_validation
on:
push:
branches:
- master
- dev
- main
pull_request:
branches:
- master
- dev
- main
jobs:
test:
name: Test-${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: "Checkout"
uses: actions/[email protected]
with:
lfs: true
fetch-depth: 0
- name: "Install .NET SDK"
uses: actions/[email protected]
with:
global-json-file: "./global.json"
- name: "Update release notes"
shell: pwsh
run: |
./build.ps1
- name: "dotnet build"
run: dotnet build -c Release
# .NET Framework tests can't run reliably on Linux, so we only do .NET 8
- name: "dotnet test"
shell: bash
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
dotnet test -c Release --framework net8.0
else
dotnet test -c Release
fi
- name: "dotnet pack"
run: dotnet pack -c Release -o ./bin/nuget
- name: "Create .NET Framework Console App and Install Akka.Analyzers"
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
# Create a directory for the .NET Framework app
mkdir DotNetFrameworkApp
cd DotNetFrameworkApp
# Create a new .NET Framework 4.8 console application manually
$csprojContent = @"
<Project Sdk=""Microsoft.NET.Sdk"">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net48</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
</Project>
"@
$csprojContent | Out-File -Encoding utf8 -FilePath DotNetFrameworkApp.csproj
# Create a basic Program.cs file
$programContent = @"
using System;
class Program
{
static void Main()
{
Console.WriteLine(""Hello, .NET Framework!"");
}
}
"@
$programContent | Out-File -Encoding utf8 -FilePath Program.cs
# Restore and build the project
dotnet restore
dotnet build
# Add the local NuGet source
dotnet nuget add source ../bin/nuget -n local
# Install Akka.Analyzers package
dotnet add package Akka.Analyzers --source local