diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index e3285926..8e0f15c0 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -55,23 +55,8 @@ jobs: shell: pwsh run: bin/fetch-cobolcheck.ps1 - - name: Setup environment - shell: pwsh - run: | - Get-Command "cobc" -ErrorAction SilentlyContinue - ls ${env:GITHUB_WORKSPACE} - ls ${env:GITHUB_WORKSPACE}\bin - ls ${env:GITHUB_WORKSPACE}\gnucobol - ls ${env:GITHUB_WORKSPACE}\gnucobol\bin - $env:Path = "${env:GITHUB_WORKSPACE}\gnucobol\bin;${env:GITHUB_WORKSPACE}\bin;${env:Path}" - printenv - [System.Environment]::SetEnvironmentVariable('COB_CONFIG_DIR', "${gnucobolDir}\config") - [System.Environment]::SetEnvironmentVariable('COB_COPY_DIR', "${gnucobolDir}\copy") - [System.Environment]::SetEnvironmentVariable('COB_CFLAGS', "-I ${gnucobolDir}\include") - [System.Environment]::SetEnvironmentVariable('COB_LDFLAGS', "-L ${gnucobolDir}\lib") - [System.Environment]::SetEnvironmentVariable('COB_LIBRARY_PATH', "${gnucobolDir}\lib") - [System.Environment]::SetEnvironmentVariable('COB_LIBS', "${gnucobolDir}\bin\libcob-4.dll") - - name: Run tests for all exercises shell: pwsh - run: bin/test.ps1 + run: | + bin/setup-environment.ps1 + bin/test.ps1 diff --git a/bin/setup-environment.ps1 b/bin/setup-environment.ps1 new file mode 100644 index 00000000..4a42589d --- /dev/null +++ b/bin/setup-environment.ps1 @@ -0,0 +1,14 @@ +Get-Command "cobc" -ErrorAction SilentlyContinue +Get-Command "cobc.exe" -ErrorAction SilentlyContinue +ls ${env:GITHUB_WORKSPACE} +ls ${env:GITHUB_WORKSPACE}\bin +ls ${env:GITHUB_WORKSPACE}\gnucobol +ls ${env:GITHUB_WORKSPACE}\gnucobol\bin +$env:Path = "${env:GITHUB_WORKSPACE}\gnucobol\bin;${env:GITHUB_WORKSPACE}\bin;${env:Path}" +printenv +[System.Environment]::SetEnvironmentVariable('COB_CONFIG_DIR', "${gnucobolDir}\config") +[System.Environment]::SetEnvironmentVariable('COB_COPY_DIR', "${gnucobolDir}\copy") +[System.Environment]::SetEnvironmentVariable('COB_CFLAGS', "-I ${gnucobolDir}\include") +[System.Environment]::SetEnvironmentVariable('COB_LDFLAGS', "-L ${gnucobolDir}\lib") +[System.Environment]::SetEnvironmentVariable('COB_LIBRARY_PATH', "${gnucobolDir}\lib") +[System.Environment]::SetEnvironmentVariable('COB_LIBS', "${gnucobolDir}\bin\libcob-4.dll")