Skip to content

Commit 6894257

Browse files
Merge pull request #1 from philips-software/chore/change-runners
chore: use public runners
2 parents 68cece3 + 9255311 commit 6894257

4 files changed

Lines changed: 23 additions & 17 deletions

File tree

.github/workflows/test.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ on:
1717

1818
jobs:
1919
test:
20-
runs-on: [self-hosted, windows, x64, philips, servercore-20H2]
20+
runs-on: windows-2019
2121
name: Test
2222
env:
2323
TEST1: Test1
2424
TEST2: Test2
2525
TEST3: ${{ secrets.TEST_SECRET }}
26+
TEST_MAPPING_PATH: "C:\\map"
2627
strategy:
2728
matrix:
28-
docker_container: ["mcr.microsoft.com/windows/servercore:20H2"]
29+
docker_container: ["mcr.microsoft.com/windows/servercore:ltsc2019"]
2930

3031
steps:
3132
- name: Checkout
@@ -36,15 +37,17 @@ jobs:
3637
uses: ./
3738
with:
3839
image: ${{ matrix.docker_container }}
40+
mapping_path: 'c:\map'
3941
entrypoint: powershell.exe
40-
env_names: GITHUB_WORKSPACE
42+
env_names: TEST_MAPPING_PATH
4143
run: >-
42-
${{ github.workspace }}\test\run_test.ps1 -testPath "${{ github.workspace }}\test\run_default.Tests.ps1";
44+
c:\map\test\run_test.ps1 -testPath "c:\map\test\run_default.Tests.ps1";
4345
4446
- name: Test_ExtraArgs
4547
uses: ./
4648
with:
4749
image: ${{ matrix.docker_container }}
50+
mapping_path: 'c:\map'
4851
workspace_path: ${{ github.workspace }}
4952
extra_args: --entrypoint cmd.exe
5053
run: >-
@@ -55,19 +58,21 @@ jobs:
5558
with:
5659
image: ${{ matrix.docker_container }}
5760
entrypoint: powershell.exe
61+
mapping_path: 'c:\map'
5862
env_names: TEST1, TEST2, TEST3
5963
run: >-
60-
${{ github.workspace }}\test\run_test.ps1 -testPath "${{ github.workspace }}\test\environment.Tests.ps1";
64+
c:\map\test\run_test.ps1 -testPath "c:\map\test\environment.Tests.ps1";
6165
6266
- name: Test_WorkPath
6367
uses: ./
6468
with:
6569
image: ${{ matrix.docker_container }}
70+
mapping_path: 'c:\map'
6671
work_path: 'c:\temp'
6772
entrypoint: powershell.exe
6873
memory: 3GB
6974
run: >-
70-
${{ github.workspace }}\test\run_test.ps1 -testPath "${{ github.workspace }}\test\work_path.Tests.ps1";
75+
c:\map\test\run_test.ps1 -testPath "c:\map\test\work_path.Tests.ps1";
7176
7277
- name: Test_MappingPath
7378
uses: ./
@@ -84,15 +89,16 @@ jobs:
8489
uses: ./
8590
with:
8691
image: ${{ matrix.docker_container }}
92+
mapping_path: 'c:\map'
8793
workspace_path: ${{ github.workspace }}/test
8894
entrypoint: powershell.exe
8995
memory: 3GB
90-
env_names: GITHUB_WORKSPACE
96+
env_names: TEST_MAPPING_PATH
9197
run: >-
92-
${{ github.workspace }}\test\run_test.ps1 -testPath "${{ github.workspace }}\test\workspace_path.Tests.ps1";
98+
c:\map\run_test.ps1 -testPath "c:\map\workspace_path.Tests.ps1";
9399
94100
validate:
95-
runs-on: [self-hosted, linux, X64, philips]
101+
runs-on: ubuntu-latest
96102
name: Validate
97103
container: mcr.microsoft.com/powershell:latest
98104

.github/workflows/update-readme.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
update-readme:
88

9-
runs-on: [self-hosted, linux, X64, philips]
9+
runs-on: ubuntu-latest
1010

1111
steps:
1212
- uses: actions/checkout@v3

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)