Skip to content

Commit

Permalink
add test workflow jobs for global.json usage
Browse files Browse the repository at this point in the history
  • Loading branch information
omsmith committed Apr 14, 2022
1 parent e7077ab commit 444a936
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/workflow.yml
Expand Up @@ -163,6 +163,103 @@ jobs:
shell: pwsh
run: __tests__/verify-dotnet.ps1 3.1 2.2

test-setup-global-json-fallback:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Write global.json
shell: bash
run: |
echo '{"sdk":{"version": "6.0.101"}}' > ./global.json
- name: Setup dotnet
uses: ./
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 6.0.101

test-setup-global-json-fallback-and-version:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Write global.json
shell: bash
run: |
echo '{"sdk":{"version": "6.0.101"}}' > ./global.json
- name: Setup dotnet
uses: ./
with:
dotnet-version: 3.1.*
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 3.1

test-setup-global-json-specified:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Write global.json
shell: bash
run: |
mkdir subdirectory
echo '{"sdk":{"version": "6.0.101"}}' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
global-json-file: ./subdirectory/global.json
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 6.0.101

test-setup-global-json-specified-and-version:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Write global.json
shell: bash
run: |
mkdir subdirectory
echo '{"sdk":{"version": "6.0.101"}}' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
dotnet-version: 3.1.*
global-json-file: ./subdirectory/global.json
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 3.1 6.0.101

test-proxy:
runs-on: ubuntu-latest
container:
Expand Down

0 comments on commit 444a936

Please sign in to comment.