Skip to content

Commit 08a4b70

Browse files
committed
Try setting the PATH in a os-aware way
1 parent ba5abc3 commit 08a4b70

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

.github/workflows/run-tests.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,25 @@ jobs:
5858
exit 1
5959
}
6060
61+
# Adding .dotnet to GITHUB_PATH as this ensures that the tests running
62+
# from the repo always use restored dotnet. For tests run from outside
63+
# the repo we install system dotnet earlier in the build
64+
6165
- name: Setup vars (Linux)
6266
if: ${{ inputs.os == 'ubuntu-latest' || inputs.os == 'macos-latest' }}
6367
run: |
6468
echo "DOTNET_SCRIPT=./dotnet.sh" >> $GITHUB_ENV
6569
echo "BUILD_SCRIPT=./build.sh" >> $GITHUB_ENV
6670
echo "TEST_RUN_PATH=${{ github.workspace }}/run-tests" >> $GITHUB_ENV
71+
echo ${{ github.workspace }}/.dotnet >> $GITHUB_PATH
6772
6873
- name: Setup vars (Windows)
6974
if: ${{ inputs.os == 'windows-latest' }}
7075
run: |
7176
echo "DOTNET_SCRIPT=.\dotnet.cmd" >> $env:GITHUB_ENV
7277
echo "BUILD_SCRIPT=.\build.cmd" >> $env:GITHUB_ENV
7378
echo "TEST_RUN_PATH=${{ github.workspace }}\run-tests" >> $env:GITHUB_ENV
79+
echo ${{ github.workspace }}\.dotnet >> $env:GITHUB_PATH
7480
7581
- name: Checkout code
7682
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -231,15 +237,6 @@ jobs:
231237
--timeout ${{ inputs.testSessionTimeout }}
232238
${{ inputs.extraTestArgs }}
233239
234-
# This ensures that the tests running from the repo always use
235-
# restored dotnet.
236-
# For tests run from outside the repo we install system dotnet
237-
# earlier in the build
238-
- name: Add .dotnet to PATH
239-
if: ${{ ! inputs.requiresNugets }}
240-
shell: bash
241-
run: echo ${{ github.workspace }}/.dotnet >> $GITHUB_PATH
242-
243240
- name: Run tests
244241
if: ${{ ! inputs.requiresNugets }}
245242
id: run-tests

0 commit comments

Comments
 (0)