Skip to content

Commit 3a32828

Browse files
committed
add curl head; also use an env var for the apama version
1 parent 242528a commit 3a32828

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/apama.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ jobs:
1919

2020
- run-id: amd64_win
2121
os: windows-latest
22-
22+
23+
env:
24+
# The 4-digit version to download from http://www.apamacommunity.com/downloads/
25+
SETUP_APAMA_VERSION: 10.5.3.2
26+
2327
runs-on: ${{matrix.os}}
2428

2529
steps:
@@ -32,12 +36,12 @@ jobs:
3236
id: cache-apama-installer
3337
with:
3438
path: ~/cached-apama-installation.tar
35-
# To use a clean cache, add extra chars to this key
36-
key: apama-${{ runner.os }}-10.5.3.2-TODO2
39+
# To use a clean cache, update the number at the end of this key
40+
key: apama-${{ runner.os }}-${{ env.SETUP_APAMA_VERSION }}-cache1
3741

3842
- uses: ./
3943
with:
40-
apama-version: 10.5.3.2
44+
apama-version: ${{ env.SETUP_APAMA_VERSION }}
4145

4246
- name: Test the Apama installation
4347
shell: bash

action.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,21 @@ runs:
2424
if [[ -f $APAMA_CACHE_TAR ]]; then
2525
echo Unpacking Apama installation from cache at $APAMA_CACHE_TAR
2626
27-
echo 1 $_SAG_INSTALL_PATH
2827
mkdir $_SAG_INSTALL_PATH
29-
echo 2
3028
cd $_SAG_INSTALL_PATH
31-
echo 3
32-
which tar
33-
tar -xf $APAMA_CACHE_TAR
34-
echo 4
35-
ls
29+
time tar -xf $APAMA_CACHE_TAR
3630
3731
# Check it unpacked correctly
38-
ls $_SAG_INSTALL_PATH/Apama > /dev/null
32+
ls $_SAG_INSTALL_PATH/Apama
3933
else
4034
echo No installation found in cache $APAMA_CACHE_TAR
4135
# Cache miss - need to install it
4236
mkdir ../apama-installer
4337
cd ../apama-installer
4438
DOWNLOAD_URL=https://downloads.apamacommunity.com/apama/${{ inputs.apama-version }}/apama_${{ inputs.apama-version }}_$DOWNLOAD_PLATFORM.zip
4539
echo Downloading from $DOWNLOAD_URL
40+
# First use head to check the URL is valid (gives a more helpful message if it doesn't)
41+
curl --retry 2 --head $DOWNLOAD_URL
4642
curl --retry 2 --output apama-installer.zip $DOWNLOAD_URL
4743
4844
unzip -q apama-installer.zip
@@ -104,10 +100,10 @@ runs:
104100
# Ideally we'd just run this in a cmd shell, but can't since it wouldn't work on Linux, and GH composite
105101
# action steps don't yet support "if".
106102
# Can't do this as part of the bash shell above, as Windows Git Bash pollutes the PATH environment.
103+
# Python to the rescue!
107104
import os
108-
if os.name=='nt':
105+
if os.name == 'nt': # Windows
109106
print('Adding apama_env.bat environment to GITHUB_ENV')
110107
cmd = r'cmd /c "%APAMA_HOME%\bin\apama_env.bat && set >> %GITHUB_ENV%"'
111-
print('Executing: %s' % cmd)
112108
os.system(cmd)
113109

0 commit comments

Comments
 (0)