Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try fix Windows caching #133

Merged
merged 6 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Loading