Skip to content

Commit

Permalink
Clean up the way matrix.os is setup and matched. (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlovic-ivan authored Sep 1, 2023
1 parent 3871196 commit 350c346
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 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 @@ -155,30 +155,26 @@ jobs:
library: [ILGPU, ILGPU.Algorithms]
framework: [net6.0, net7.0]
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 6 SDK
if: matrix.framework == 'net6.0'
uses: actions/[email protected]
env:
DOTNET_INSTALL_DIR: ${{ matrix.framework == 'cuda' && '~/.' }}
with:
dotnet-version: 6.0.x

- name: Setup the latest .NET 7 SDK
uses: actions/[email protected]
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

0 comments on commit 350c346

Please sign in to comment.