Create greetings.yml #22
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: Windows Workflow Example | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-test: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: choco install dotnetcore-sdk | |
shell: powershell | |
- name: Compile and run C# program | |
run: | | |
Add-Content -Path "Hello.cs" -Value @" | |
using System; | |
public class Hello | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine("Hello, Windows from C#"); | |
} | |
} | |
"@ | |
dotnet new console --force --no-restore | |
Move-Item -Path "Hello.cs" -Destination "Program.cs" -Force | |
dotnet run | |
shell: powershell |