Skip to content

Commit

Permalink
Added a GitHub Actions workflow to run the build script on pull reque…
Browse files Browse the repository at this point in the history
…sts.
  • Loading branch information
csdahlberg committed Jun 29, 2024
1 parent 8ce7f8c commit 128df14
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Test

on:
push:
branches:
- 'master'
- 'feature/github-actions'
pull_request:
branches:
- 'master'

jobs:
build-and-test-windows:
name: Build and test (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build and test
shell: pwsh
run: |
.\Build.ps1
build-and-test-linux:
name: Build and test (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and test
shell: pwsh
run: |
.\Build.ps1 -SkipVsix
3 changes: 2 additions & 1 deletion Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ $roslynVersions | Foreach-Object {
if (-not $SkipTests) {
Write-Host ""
Write-Host "Running unit tests for CodeTiger.CodeAnalysis.sln..." -ForegroundColor Cyan
$testDllPath = [IO.Path]::Combine($PSScriptRoot, "Build", $configuration, "roslyn$roslynVersion", "net7.0", "UnitTests.CodeTiger.CodeAnalysis.dll")
$testDllPath = [IO.Path]::Combine($PSScriptRoot, "Build", $configuration, "roslyn$roslynVersion", "UnitTests.CodeTiger.CodeAnalysis.dll")
& $vstestPath @($testDllPath, "/Parallel", "/Logger:Console;Verbosity=$verbosity")

if ($LASTEXITCODE -ne 0)
Expand Down Expand Up @@ -134,6 +134,7 @@ $roslynVersions | Foreach-Object {

if (-not $SkipTests) {

$configuration = 'Release'
# Run self-testing with the latest supported version of Roslyn so that newer language features can be used
$roslynVersion = "4.4"

Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<!-- Default to the highest supported version of Roslyn for the best IDE experience. -->
<RoslynVersion Condition="'$(RoslynVersion)'==''">4.4</RoslynVersion>
<BaseIntermediateOutputPath>$(ProjectDir)obj\roslyn$(RoslynVersion)\</BaseIntermediateOutputPath>

<!-- Disable appending things like 'netstandard2.0' to output paths -->
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<!-- Visual Studio 2017 15.5 / C# 7.2 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework Condition="'$(RoslynVersion)'!='2.6'">netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<DocumentationFile>bin\$(Configuration)\roslyn$(RoslynVersion)\$(TargetFramework)\CodeTiger.CodeAnalysis.SelfTest.xml</DocumentationFile>
<DocumentationFile>bin\$(Configuration)\roslyn$(RoslynVersion)\CodeTiger.CodeAnalysis.SelfTest.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down

0 comments on commit 128df14

Please sign in to comment.