Skip to content

Commit fdd9cef

Browse files
authored
Merge pull request #249 from Susko3/add-ci-build-workflow
Add CI build workflow
2 parents 16c954e + 95010b0 commit fdd9cef

6 files changed

Lines changed: 88 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Continuous Integration
2+
on: [push, pull_request]
3+
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: true
7+
8+
permissions:
9+
contents: read # to fetch code (actions/checkout)
10+
11+
jobs:
12+
build-only-desktop:
13+
name: Build only (Desktop)
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 60
16+
env:
17+
CI_DONT_TARGET_ANDROID: 1
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Install .NET 8.0.x
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: "8.0.x"
26+
27+
- name: Build
28+
run: dotnet build -c Debug SDL3-CS.Desktop.slnf
29+
30+
build-only-android:
31+
name: Build only (Android)
32+
runs-on: windows-latest
33+
timeout-minutes: 60
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
38+
- name: Setup JDK 11
39+
uses: actions/setup-java@v4
40+
with:
41+
distribution: microsoft
42+
java-version: 11
43+
44+
- name: Install .NET 8.0.x
45+
uses: actions/setup-dotnet@v4
46+
with:
47+
dotnet-version: "8.0.x"
48+
49+
- name: Install .NET workloads
50+
run: dotnet workload install android
51+
52+
- name: Build
53+
run: dotnet build -c Debug SDL3-CS.Android.slnf
54+
55+
build-only-ios:
56+
name: Build only (iOS)
57+
runs-on: macos-15
58+
timeout-minutes: 60
59+
env:
60+
CI_DONT_TARGET_ANDROID: 1
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v4
64+
65+
- name: Install .NET 8.0.x
66+
uses: actions/setup-dotnet@v4
67+
with:
68+
dotnet-version: "8.0.x"
69+
70+
- name: Install .NET Workloads
71+
run: dotnet workload install ios
72+
73+
# https://github.com/dotnet/macios/issues/19157
74+
# https://github.com/actions/runner-images/issues/12758
75+
- name: Use Xcode 16.4
76+
run: sudo xcode-select -switch /Applications/Xcode_16.4.app
77+
78+
- name: Build
79+
run: dotnet build -c Debug SDL3-CS.iOS.slnf

SDL3-CS.Tests/SDL3-CS.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</ItemGroup>
2929

3030
<ItemGroup>
31-
<None Include="..\External\SDL_image\test\sample.png">
31+
<None Include="..\External\SDL_image\test\sample.png" Condition="Exists('..\External\SDL_image\test\sample.png')">
3232
<Link>sample.png</Link>
3333
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3434
</None>

SDL3-CS/SDL3-CS.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
<PropertyGroup>
44
<RootNamespace>SDL</RootNamespace>
5-
<TargetFrameworks>net8.0;net8.0-android</TargetFrameworks>
5+
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks>
6+
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
67
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
78
<Nullable>enable</Nullable>
89
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

SDL3_image-CS/SDL3_image-CS.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net8.0-android</TargetFrameworks>
4+
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks>
5+
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
56
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
67
<RootNamespace>SDL</RootNamespace>
78
<Nullable>enable</Nullable>

SDL3_mixer-CS/SDL3_mixer-CS.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net8.0-android</TargetFrameworks>
4+
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks>
5+
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
56
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
67
<RootNamespace>SDL</RootNamespace>
78
<Nullable>enable</Nullable>

SDL3_ttf-CS/SDL3_ttf-CS.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net8.0-android</TargetFrameworks>
4+
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks>
5+
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
56
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
67
<RootNamespace>SDL</RootNamespace>
78
<Nullable>enable</Nullable>

0 commit comments

Comments
 (0)