Skip to content

ベクトルの移動量を取る右シフトを固定する #396

ベクトルの移動量を取る右シフトを固定する

ベクトルの移動量を取る右シフトを固定する #396

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
paths-ignore:
- "*.md"
- ".github/LICENSE/**"
pull_request:
branches: ["main"]
paths-ignore:
- "*.md"
- ".github/LICENSE/**"
permissions:
contents: read
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
DOTNET_NOLOGO: "1"
jobs:
build:
name: ビルドとテスト
runs-on: windows-2022
defaults:
run:
shell: bash
# ComputeWeave.Dxc が参照する環境変数。
# https://github.com/actions/runner-images/issues/6531 への対処。
env:
CI_RUNNER_DOTNET_TEST_PLATFORM: x64
steps:
- name: ソースコードを取得
uses: actions/checkout@v4
- name: .NET SDK をセットアップ
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.x"
- name: NuGet パッケージをキャッシュ
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', 'build/Directory.Build.props') }}
restore-keys: nuget-${{ runner.os }}-
- name: ソリューションをビルド
run: dotnet build ComputeWeave.sln -c Release -p:Platform=x64
# 明示した Platform より環境変数が優先されると、ARM64 の構築が x64 のライブラリを置く。
- name: DXCの複製先を検証
run: pwsh build/verify-dxc-native-copy.ps1
- name: ソースジェネレーターのテストを実行
run: dotnet test tests/ComputeWeave.Tests.SourceGenerators/ComputeWeave.Tests.SourceGenerators.csproj -c Release -p:Platform=x64
- name: 内部実装のテストを実行
run: dotnet test tests/ComputeWeave.Tests.Internals/ComputeWeave.Tests.Internals.csproj -c Release -p:Platform=x64
- name: 本体のテストを実行
run: dotnet test tests/ComputeWeave.Tests/ComputeWeave.Tests.csproj -c Release -p:Platform=x64
# D2D1 の本体のテストは、ハードウェアが取れなければ WARP へ退避する。アダプターの無い runner でも走る。
- name: D2D1の本体のテストを実行
run: dotnet test tests/ComputeWeave.D2D1.Tests/ComputeWeave.D2D1.Tests.csproj -c Release -p:Platform=x64
- name: D2D1のソースジェネレーターのテストを実行
run: dotnet test tests/ComputeWeave.D2D1.Tests.SourceGenerators/ComputeWeave.D2D1.Tests.SourceGenerators.csproj -c Release -p:Platform=x64
- name: D2D1のアセンブリ属性のテストを実行
run: dotnet test tests/ComputeWeave.D2D1.Tests.AssemblyLevelAttributes/ComputeWeave.D2D1.Tests.AssemblyLevelAttributes.csproj -c Release -p:Platform=x64
# 最上位ステートメントのテストは Exe でありビルドだけでは実行時の不一致を検出できないため、実際に走らせる。
- name: 最上位ステートメントのテストを実行
run: dotnet run --project tests/ComputeWeave.Tests.GlobalStatements/ComputeWeave.Tests.GlobalStatements.csproj -c Release -p:Platform=x64
- name: パッケージが正常に作成されるか確認
run: |
dotnet pack src/ComputeWeave.Core/ComputeWeave.Core.csproj -c Release
dotnet pack src/ComputeWeave/ComputeWeave.csproj -c Release
dotnet pack src/ComputeWeave.Dxc/ComputeWeave.Dxc.csproj -c Release
dotnet pack src/ComputeWeave.D3D12MemoryAllocator/ComputeWeave.D3D12MemoryAllocator.csproj -c Release
dotnet pack src/ComputeWeave.D2D1/ComputeWeave.D2D1.csproj -c Release
# パッケージIDと版だけでは、同梱ライブラリや生成器が失われたことを検出できない。書庫の中身を見る。
- name: パッケージの積荷を検証
run: pwsh build/verify-package-payload.ps1
# ネイティブライブラリ解決のテストは発行と実行を繰り返すため手元の実測で5分から8分かかり、ここでは回さない。
# デバイス消失のテストは実デバイスを破棄するため、他のテストとは別のプロセスで実行する。
test-device-lost:
name: デバイス消失のテスト
runs-on: windows-2022
defaults:
run:
shell: bash
env:
CI_RUNNER_DOTNET_TEST_PLATFORM: x64
steps:
- name: ソースコードを取得
uses: actions/checkout@v4
- name: .NET SDK をセットアップ
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.x"
- name: デバイス消失のテストを実行
run: dotnet test tests/ComputeWeave.Tests.DeviceLost/ComputeWeave.Tests.DeviceLost.csproj -c Release -p:Platform=x64