Skip to content

Commit

Permalink
Try fix Windows caching (#133)
Browse files Browse the repository at this point in the history
* Try fix caching

* Try fix cache path

* Try include cobolcheck

* Try include cobolcheck

* Use home dir

* Use home dir
  • Loading branch information
ErikSchierboom authored Apr 19, 2024
1 parent 6c84aef commit 1d8b313
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ jobs:

- name: Cache GnuCOBOL
id: cache-gnu-cobol
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: $HOME\gnucobol-3.2.7z
key: ${{ runner.os }}-gnu-cobol-3.2
path: |
~/gnucobol
~/cobolcheck
key: gnucobol-3.2.7-cobolcheck-v1

- name: Download GnuCOBOL
if: steps.cache-gnu-cobol.outputs.cache-hit != 'true'
Expand All @@ -46,12 +48,10 @@ jobs:
RetryIntervalSec = 1
}
Invoke-WebRequest -Uri 'https://www.arnoldtrembley.com/GC32-BDB-SP1-rename-7z-to-exe.7z' -OutFile $HOME\gnucobol-3.2.7z @requestOpts
7z x $HOME\gnucobol-3.2.7z -o"${HOME}\gnucobol" -y
- name: Extract GnuCOBOL
shell: pwsh
run: 7z x $HOME\gnucobol-3.2.7z -ognucobol -y

- name: Fetch CobolCheck
- name: Download CobolCheck
if: steps.cache-gnu-cobol.outputs.cache-hit != 'true'
shell: pwsh
run: bin/fetch-cobolcheck.ps1

Expand Down
4 changes: 3 additions & 1 deletion bin/fetch-cobolcheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ Function Get-DownloadUrl {
}

$downloadUrl = Get-DownloadUrl
$outputFile = Join-Path -Path $PSScriptRoot -ChildPath "cobolcheck.exe"
$outputDir = Join-Path -Path $HOME -ChildPath "cobolcheck"
$outputFile = Join-Path -Path $outputDir -ChildPath "cobolcheck.exe"
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
16 changes: 9 additions & 7 deletions bin/setup-environment.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
$env:Path = "${env:GITHUB_WORKSPACE}\gnucobol\bin;${env:GITHUB_WORKSPACE}\bin;${env:Path}"
[System.Environment]::SetEnvironmentVariable('COB_CONFIG_DIR', "${env:GITHUB_WORKSPACE}\gnucobol\config")
[System.Environment]::SetEnvironmentVariable('COB_COPY_DIR', "${env:GITHUB_WORKSPACE}\gnucobol\copy")
[System.Environment]::SetEnvironmentVariable('COB_CFLAGS', "-I ${env:GITHUB_WORKSPACE}\gnucobol\include")
[System.Environment]::SetEnvironmentVariable('COB_LDFLAGS', "-L ${env:GITHUB_WORKSPACE}\gnucobol\lib")
[System.Environment]::SetEnvironmentVariable('COB_LIBRARY_PATH', "${env:GITHUB_WORKSPACE}\gnucobol\lib")
[System.Environment]::SetEnvironmentVariable('COB_LIBS', "${env:GITHUB_WORKSPACE}\gnucobol\bin\libcob-4.dll")
$gnucobolDir = "${HOME}\gnucobol"
$cobolcheckDir = "${HOME}\cobolcheck"
$env:Path = "${gnucobolDir}\bin;${cobolcheckDir};${env:Path}"
[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")

0 comments on commit 1d8b313

Please sign in to comment.