Skip to content

Commit a600fa8

Browse files
runners for macos and windows
1 parent 4f56710 commit a600fa8

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/runner-macos.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: macOS Workflow Example
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-test:
10+
runs-on: macos-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Create Swift File
17+
run: |
18+
echo 'print("Hello from Swift on macOS")' > hello.swift
19+
20+
- name: Install dependencies
21+
run: |
22+
brew install swiftlint
23+
24+
- name: Run SwiftLint
25+
run: swiftlint
26+
27+
- name: Compile and run Swift program
28+
run: |
29+
swiftc hello.swift
30+
./hello
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Windows Workflow Example
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build-and-test:
13+
runs-on: windows-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Install dependencies
20+
run: choco install dotnetcore-sdk
21+
shell: powershell
22+
23+
- name: Compile and run C# program
24+
run: |
25+
Add-Content -Path "Hello.cs" -Value @"
26+
using System;
27+
public class Hello
28+
{
29+
public static void Main()
30+
{
31+
Console.WriteLine("Hello, Windows from C#");
32+
}
33+
}
34+
"@
35+
dotnet new console --force --no-restore
36+
Move-Item -Path "Hello.cs" -Destination "Program.cs" -Force
37+
dotnet run
38+
shell: powershell

0 commit comments

Comments
 (0)