Merge pull request #249 from Susko3/add-ci-build-workflow

Add CI build workflow
This commit is contained in:
Dan Balasescu 2025-08-31 08:02:59 +09:00 committed by GitHub
commit fdd9cef146
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 88 additions and 5 deletions

79
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,79 @@
name: Continuous Integration
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build-only-desktop:
name: Build only (Desktop)
runs-on: ubuntu-latest
timeout-minutes: 60
env:
CI_DONT_TARGET_ANDROID: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Build
run: dotnet build -c Debug SDL3-CS.Desktop.slnf
build-only-android:
name: Build only (Android)
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK 11
uses: actions/setup-java@v4
with:
distribution: microsoft
java-version: 11
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Install .NET workloads
run: dotnet workload install android
- name: Build
run: dotnet build -c Debug SDL3-CS.Android.slnf
build-only-ios:
name: Build only (iOS)
runs-on: macos-15
timeout-minutes: 60
env:
CI_DONT_TARGET_ANDROID: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Install .NET Workloads
run: dotnet workload install ios
# https://github.com/dotnet/macios/issues/19157
# https://github.com/actions/runner-images/issues/12758
- name: Use Xcode 16.4
run: sudo xcode-select -switch /Applications/Xcode_16.4.app
- name: Build
run: dotnet build -c Debug SDL3-CS.iOS.slnf

View File

@ -28,7 +28,7 @@
</ItemGroup>
<ItemGroup>
<None Include="..\External\SDL_image\test\sample.png">
<None Include="..\External\SDL_image\test\sample.png" Condition="Exists('..\External\SDL_image\test\sample.png')">
<Link>sample.png</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

View File

@ -2,7 +2,8 @@
<PropertyGroup>
<RootNamespace>SDL</RootNamespace>
<TargetFrameworks>net8.0;net8.0-android</TargetFrameworks>
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks>
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android</TargetFrameworks>
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks>
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<RootNamespace>SDL</RootNamespace>
<Nullable>enable</Nullable>

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android</TargetFrameworks>
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks>
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<RootNamespace>SDL</RootNamespace>
<Nullable>enable</Nullable>

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android</TargetFrameworks>
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks>
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<RootNamespace>SDL</RootNamespace>
<Nullable>enable</Nullable>