Skip to content

Commit 5872d2c

Browse files
Merge pull request philips-software#14 from philips-software/feature/mount-github-actions-_temp-path
chore: mount GitHub Actions _temp path
2 parents 5e98f80 + 01d5ac7 commit 5872d2c

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,14 @@ runs:
9393
shell: powershell
9494
- name: Run
9595
run: >-
96+
$eventPath = Split-Path -Path "${env:GITHUB_EVENT_PATH}" -Parent;
97+
9698
docker run
9799
${{ steps.settings.outputs.default_environment_variables }}
98100
${{ steps.settings.outputs.extra_args }}
99-
--rm
101+
--rm
100102
--memory=${{ inputs.memory }}
103+
-v ${eventPath}:${eventPath}
101104
-v ${{ steps.settings.outputs.workspace_path }}:${{ steps.settings.outputs.mapping_path }}
102105
-w ${{ steps.settings.outputs.work_path }}
103106
${{ inputs.image }}

test/run_default.Tests.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ Describe "run_default" {
1313
$testfile | Should -Exist
1414
}
1515
}
16+
17+
Context "default GitHub Action paths should be available" {
18+
It "GITHUB_EVENT_PATH should exist" {
19+
"$env:GITHUB_EVENT_PATH" | Should -Exist
20+
}
21+
}
1622
}

test/run_test.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ if (-not(Test-Path -Path $testPath -PathType Leaf))
88
exit 1;
99
}
1010

11-
# using scoop to install pester
12-
mkdir C:\TMP;
13-
powershell.exe -ExecutionPolicy RemoteSigned `Invoke-WebRequest 'https://get.scoop.sh' -outfile C:\TMP\install.ps1;
14-
C:\TMP\install.ps1 -RunAsAdmin;
15-
scoop install pester;
11+
Install-PackageProvider NuGet -Force;
12+
If ($? -ne "True" ) { Throw };
13+
Install-Module -Force -SkipPublisherCheck Pester;
14+
If ($? -ne "True" ) { Throw };
1615

1716
$config=New-PesterConfiguration;
17+
If ($? -ne "True" ) { Throw };
1818
$config.Run.Exit=$true;
19+
If ($? -ne "True" ) { Throw };
1920
$config.Run.Path="$testPath";
21+
If ($? -ne "True" ) { Throw };
2022

2123
Invoke-Pester -Configuration $config;
24+
If ($? -ne "True" ) { Throw };

0 commit comments

Comments
 (0)