Skip to content

Commit

Permalink
Speculative fix for github/windows build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Dec 12, 2021
1 parent 0edadc4 commit 7692c81
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
19 changes: 19 additions & 0 deletions Build/actions.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,25 @@ module Actions =
Assert.Fail "Could not clean all the files"

clean1 0

let CleanDir folder =
let rec clean1 depth =
try
Shell.deleteDir folder
with
| :? System.IO.IOException as x -> clean' (x :> Exception) depth
| :? System.UnauthorizedAccessException as x -> clean' (x :> Exception) depth

and clean' x depth =
printfn "looping after %A" x
System.Threading.Thread.Sleep(500)

if depth < 10 then
clean1 (depth + 1)
else
Assert.Fail "Could not clean all the files"

clean1 0

let template =
"""namespace AltCover
Expand Down
18 changes: 9 additions & 9 deletions Build/targets.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -2409,7 +2409,7 @@ _Target
(nugetCache @@ "altcover") @@ Version.Value
//printfn "Should clear %A" folder
Shell.mkdir folder
Shell.deleteDir folder
Actions.CleanDir folder

let xmlreports =
tests
Expand Down Expand Up @@ -5581,7 +5581,7 @@ group NetcoreBuild
(fun f ->
let folder = (nugetCache @@ f) @@ Version.Value
Shell.mkdir folder
Shell.deleteDir folder))
Actions.CleanDir folder))

_Target
"DotnetTestIntegration"
Expand Down Expand Up @@ -6272,7 +6272,7 @@ _Target
(nugetCache @@ "altcover") @@ Version.Value

Shell.mkdir folder
Shell.deleteDir folder)
Actions.CleanDir folder)

_Target
"Issue20"
Expand Down Expand Up @@ -6395,7 +6395,7 @@ _Target
(nugetCache @@ "altcover") @@ Version.Value

Shell.mkdir folder
Shell.deleteDir folder)
Actions.CleanDir folder)

_Target
"Issue23"
Expand Down Expand Up @@ -6470,7 +6470,7 @@ _Target
(nugetCache @@ "altcover") @@ Version.Value

Shell.mkdir folder
Shell.deleteDir folder)
Actions.CleanDir folder)

_Target
"Issue67"
Expand Down Expand Up @@ -6560,7 +6560,7 @@ _Target
(nugetCache @@ "altcover") @@ Version.Value

Shell.mkdir folder
Shell.deleteDir folder)
Actions.CleanDir folder)

_Target
"Issue72"
Expand Down Expand Up @@ -6755,7 +6755,7 @@ _Target
(nugetCache @@ "altcover") @@ Version.Value

Shell.mkdir folder
Shell.deleteDir folder)
Actions.CleanDir folder)

_Target
"DotnetGlobalIntegration"
Expand Down Expand Up @@ -6896,7 +6896,7 @@ _Target
(nugetCache @@ "altcover.global") @@ Version.Value

Shell.mkdir folder
Shell.deleteDir folder)
Actions.CleanDir folder)

_Target
"Issue114"
Expand Down Expand Up @@ -6974,7 +6974,7 @@ _Target
(nugetCache @@ "altcover.api") @@ Version.Value

Shell.mkdir folder
Shell.deleteDir folder)
Actions.CleanDir folder)

// AOB

Expand Down

0 comments on commit 7692c81

Please sign in to comment.