Skip to content

add support for concurrent runs, better agent support, running a locally built jar #6

add support for concurrent runs, better agent support, running a locally built jar

add support for concurrent runs, better agent support, running a locally built jar #6

Workflow file for this run

name: Webroot Handling Matrix
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Run default test (index.cfm)
run: ant -Dwebroot=webroot -Dexecute=index.cfm
- name: Run subfolder test (sub/test.cfm)
run: ant -Dwebroot=webroot -Dexecute=sub/test.cfm
- name: Run test.cfm
run: ant -Dwebroot=webroot -Dexecute=test.cfm
# Add more steps for other argument combinations if needed
ubuntu-pwsh:
name: Ubuntu PowerShell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: pwsh
run: |
$webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}/webroot", '"./webroot"', '"${{ github.workspace }}/webroot"')
$executes = @('index.cfm', 'test.cfm', 'sub/test.cfm')
foreach ($w in $webroots) {
foreach ($e in $executes) {
Write-Host "Testing webroot=$w execute=$e"
$result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1
if ($LASTEXITCODE -ne 0) {
$cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true"
$platform = "ubuntu-latest"
$shell = "pwsh"
"## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY
}
}
}
working-directory: ${{ github.workspace }}
- name: Check output
shell: pwsh
run: |
Select-String 'webroot test:' logs/* | Out-Null; if ($LASTEXITCODE -ne 0) { Write-Host 'webroot test output not found'; exit 1 }
working-directory: ${{ github.workspace }}
macos-bash:
name: MacOS Bash
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: bash
run: |
webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' )
executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' )
for w in "${webroots[@]}"; do
for e in "${executes[@]}"; do
echo "Testing webroot=$w execute=$e"
result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1)
if [ $? -ne 0 ]; then
cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true"
platform="macos-latest"
shell="bash"
echo -e "## Platform: $platform | Shell: $shell\n### $cmd\nFAILED: $w / $e\n$result\n" >> "$GITHUB_STEP_SUMMARY"
fi
done
done
working-directory: ${{ github.workspace }}
- name: Check output
shell: bash
run: |
grep 'webroot test:' logs/* || (echo 'webroot test output not found' && exit 1)
working-directory: ${{ github.workspace }}
macos-pwsh:
name: MacOS PowerShell
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: pwsh
run: |
$webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}/webroot", '"./webroot"', '"${{ github.workspace }}/webroot"')
$executes = @('index.cfm', 'test.cfm', 'sub/test.cfm')
foreach ($w in $webroots) {
foreach ($e in $executes) {
Write-Host "Testing webroot=$w execute=$e"
$result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1
if ($LASTEXITCODE -ne 0) {
$cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true"
$platform = "macos-latest"
$shell = "pwsh"
"## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY
}
}
}
working-directory: ${{ github.workspace }}
- name: Check output
shell: pwsh
run: |
Select-String 'webroot test:' logs/* | Out-Null; if ($LASTEXITCODE -ne 0) { Write-Host 'webroot test output not found'; exit 1 }
working-directory: ${{ github.workspace }}
windows-cmd:
name: Windows CMD
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: cmd
run: |
set webroots=.,./webroot,webroot,"${{ github.workspace }}\webroot","./webroot","${{ github.workspace }}\\webroot"
set executes=index.cfm,test.cfm,sub/test.cfm
for %w in (%webroots%) do (
for %e in (%executes%) do (
echo Testing webroot=%w execute=%e
ant -buildfile build.xml -Dwebroot=%w -Dexecute=%e -DuniqueWorkingDir=true > result.txt 2>&1
if errorlevel 1 (
set cmd=ant -buildfile build.xml -Dwebroot=%w -Dexecute="%e" -DuniqueWorkingDir=true
echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY%
echo ### %cmd%>> %GITHUB_STEP_SUMMARY%
echo FAILED: %w / %e:>> %GITHUB_STEP_SUMMARY%
type result.txt >> %GITHUB_STEP_SUMMARY%
echo.>> %GITHUB_STEP_SUMMARY%
)
)
)
working-directory: ${{ github.workspace }}
- name: Check output
shell: cmd
run: |
findstr "webroot test:" logs\* || (echo webroot test output not found && exit 1)
working-directory: ${{ github.workspace }}
windows-pwsh:
name: Windows PowerShell
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: pwsh
run: |
$webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}\webroot", '"./webroot"', '"${{ github.workspace }}\\webroot"')
$executes = @('index.cfm', 'test.cfm', 'sub/test.cfm')
foreach ($w in $webroots) {
foreach ($e in $executes) {
Write-Host "Testing webroot=$w execute=$e"
$result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1
if ($LASTEXITCODE -ne 0) {
$cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true"
$platform = "windows-latest"
$shell = "pwsh"
"## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY
}
}
}
working-directory: ${{ github.workspace }}
- name: Check output
shell: pwsh
run: |
Select-String 'webroot test:' logs/* | Out-Null; if ($LASTEXITCODE -ne 0) { Write-Host 'webroot test output not found'; exit 1 }
working-directory: ${{ github.workspace }}
windows-bash:
name: Windows Bash
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run all webroot/execute combinations
shell: bash
run: |
webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' )
executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' )
for w in "${webroots[@]}"; do
for e in "${executes[@]}"; do
echo "Testing webroot=$w execute=$e"
result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1)
if [ $? -ne 0 ]; then
cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true"
platform="windows-latest"
shell="bash"
echo -e "## Platform: $platform | Shell: $shell\n### $cmd\nFAILED: $w / $e\n$result\n" >> "$GITHUB_STEP_SUMMARY"
fi
done
done
working-directory: ${{ github.workspace }}
- name: Check output
shell: bash
run: |
grep 'webroot test:' logs/* || (echo 'webroot test output not found' && exit 1)
working-directory: ${{ github.workspace }}