Skip to content

Commit 624f4e0

Browse files
committed
Add e2e test
1 parent e968ad8 commit 624f4e0

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/windos-fix.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Windows fix validation
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- '**.md'
7+
push:
8+
branches:
9+
- main
10+
- releases/*
11+
paths-ignore:
12+
- '**.md'
13+
-
14+
jobs:
15+
setup-version:
16+
runs-on: ${{ matrix.operating-system }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
operating-system: [windows-2019, windows-2020]
21+
dotnet-version: ['2.1', '2.2', '3.0', '3.1', '5.0', '6.0', '7.0', '8.0']
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
26+
- name: Clear toolcache
27+
shell: pwsh
28+
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
29+
30+
- name: Take note of the current time
31+
run: Get-Date | Out-File -FilePath "timestamp.txt"
32+
33+
- name: Setup dotnet ${{ matrix.dotnet-version }}
34+
uses: ./
35+
with:
36+
dotnet-version: ${{ matrix.dotnet-version }}
37+
38+
- name: Verify the action took less than 1 minute
39+
run: |
40+
$timestamp = Get-Content -Path "timestamp.txt"
41+
$now = Get-Date
42+
$diff = $now - $timestamp
43+
if ($diff.TotalMinutes -gt 1) {
44+
throw "The action took longer than 1 minute to run"
45+
}
46+
47+
- name: Verify dotnet was installed on drive D
48+
run: |
49+
$dotnetPath = Get-ChildItem -Path "D:\Program Files\dotnet" -Directory -Name
50+
if ($dotnetPath -eq $null) {
51+
throw "dotnet was not installed on drive D"
52+
}

0 commit comments

Comments
 (0)