Skip to content

Commit 9255311

Browse files
chore: use mapping path
1 parent 354c012 commit 9255311

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

.github/workflows/test.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
TEST1: Test1
2424
TEST2: Test2
2525
TEST3: ${{ secrets.TEST_SECRET }}
26-
TEST_PATH: "c:/map"
26+
TEST_MAPPING_PATH: "C:\\map"
2727
strategy:
2828
matrix:
2929
docker_container: ["mcr.microsoft.com/windows/servercore:ltsc2019"]
@@ -39,7 +39,7 @@ jobs:
3939
image: ${{ matrix.docker_container }}
4040
mapping_path: 'c:\map'
4141
entrypoint: powershell.exe
42-
env_names: TEST_PATH
42+
env_names: TEST_MAPPING_PATH
4343
run: >-
4444
c:\map\test\run_test.ps1 -testPath "c:\map\test\run_default.Tests.ps1";
4545
@@ -48,7 +48,7 @@ jobs:
4848
with:
4949
image: ${{ matrix.docker_container }}
5050
mapping_path: 'c:\map'
51-
workspace_path: 'c:\map'
51+
workspace_path: ${{ github.workspace }}
5252
extra_args: --entrypoint cmd.exe
5353
run: >-
5454
echo "Hello world";
@@ -58,6 +58,7 @@ jobs:
5858
with:
5959
image: ${{ matrix.docker_container }}
6060
entrypoint: powershell.exe
61+
mapping_path: 'c:\map'
6162
env_names: TEST1, TEST2, TEST3
6263
run: >-
6364
c:\map\test\run_test.ps1 -testPath "c:\map\test\environment.Tests.ps1";
@@ -89,12 +90,12 @@ jobs:
8990
with:
9091
image: ${{ matrix.docker_container }}
9192
mapping_path: 'c:\map'
92-
workspace_path: 'c:\map\test'
93+
workspace_path: ${{ github.workspace }}/test
9394
entrypoint: powershell.exe
9495
memory: 3GB
95-
env_names: GITHUB_WORKSPACE
96+
env_names: TEST_MAPPING_PATH
9697
run: >-
97-
c:\map\test\run_test.ps1 -testPath "c:\map\test\workspace_path.Tests.ps1";
98+
c:\map\run_test.ps1 -testPath "c:\map\workspace_path.Tests.ps1";
9899
99100
validate:
100101
runs-on: ubuntu-latest

test/run_default.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ Describe "run_default" {
22
Context "when no workspace, mapping, work path is used" {
33
It "current directory should be github workspace path" {
44
$currentdir = "$pwd"
5-
$github_workspace = "$env:GITHUB_WORKSPACE"
6-
Write-Output $currentdir | Should -Be $github_workspace
5+
$github_workspace = "$env:TEST_MAPPING_PATH"
6+
Write-Output $currentdir | Should -BeLike $github_workspace
77
}
88
}
99

1010
Context "when no workspace, mapping, work path is used" {
1111
It "work directory directory should point to github workspace path" {
12-
$testfile = "$env:GITHUB_WORKSPACE" + "\test\run_default.Tests.ps1"
12+
$testfile = "$env:TEST_MAPPING_PATH" + "\test\run_default.Tests.ps1"
1313
$testfile | Should -Exist
1414
}
1515
}

test/workspace_path.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Describe "workspace_path" {
22
Context "when workspace path is set to test" {
3-
It "current directory should be github workspace/test" {
4-
$current = $env:GITHUB_WORKSPACE + "\test"
5-
Write-Output $pwd | Should -Be $current
3+
It "current directory should be github workspace" {
4+
$current = $env:TEST_MAPPING_PATH
5+
Write-Output $pwd | Should -BeLike $current
66
}
77
}
88

@@ -15,7 +15,7 @@ Describe "workspace_path" {
1515

1616
Context "when workspace path is set to test" {
1717
It "high level files should not exist" {
18-
$test_file = $env:GITHUB_WORKSPACE + "\README.md"
18+
$test_file = $env:TEST_MAPPING_PATH + "\README.md"
1919
$test_file | Should -Not -Exist
2020
}
2121
}

0 commit comments

Comments
 (0)