Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up the way matrix.os is setup and matched. #1093

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
)
) && os+=("macos-latest")

[ "${{ steps.is-fork.outputs.fork }}" == "false" ] && os+=("cuda-${{ github.run_id }}-${{ github.run_attempt }}")
[ "${{ steps.is-fork.outputs.fork }}" == "false" ] && os+=("cuda")

echo "os=$(jq -cn '$ARGS.positional' --args ${os[@]})" >> $GITHUB_OUTPUT
outputs:
Expand Down Expand Up @@ -162,46 +162,38 @@ jobs:
library: ILGPU.Algorithms
framework: net471
fail-fast: false
runs-on: ${{ contains(matrix.os, 'cuda') && format('{0}-{1}-{2}', matrix.os, matrix.library, matrix.framework) || matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup the latest .NET Core 3.1 SDK
if: matrix.framework == 'netcoreapp3.1'
uses: actions/setup-dotnet@v3.2.0
env:
DOTNET_INSTALL_DIR: ${{ matrix.framework == 'cuda' && '~/.' }}
with:
dotnet-version: 3.1.x

- name: Setup the latest .NET 5 SDK
if: matrix.framework == 'net5.0'
uses: actions/setup-dotnet@v3.2.0
env:
DOTNET_INSTALL_DIR: ${{ matrix.framework == 'cuda' && '~/.' }}
with:
dotnet-version: 5.0.x

- name: Setup the latest .NET 6 SDK
if: matrix.framework == 'net6.0'
uses: actions/setup-dotnet@v3.2.0
env:
DOTNET_INSTALL_DIR: ${{ matrix.framework == 'cuda' && '~/.' }}
with:
dotnet-version: 6.0.x

- name: Setup the latest .NET 7 SDK
uses: actions/setup-dotnet@v3.2.0
env:
DOTNET_INSTALL_DIR: ${{ matrix.framework == 'cuda' && '~/.' }}
with:
dotnet-version: 7.0.x

- name: Set test flavor
id: test-flavor
shell: bash
run: echo "flavor=$([[ "${{ matrix.os }}" == cuda-* ]] && echo "Cuda" || echo "CPU")" >> $GITHUB_OUTPUT
run: echo "flavor=$([[ "${{ matrix.os }}" == cuda ]] && echo "Cuda" || echo "CPU")" >> $GITHUB_OUTPUT

- name: Build and test
run: dotnet test Src/${{ matrix.library }}.Tests.${{ steps.test-flavor.outputs.flavor }} --configuration=Release --framework=${{ matrix.framework }} -p:TreatWarningsAsErrors=true
Expand Down