Update webroot-matrix.yml #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: Cache Maven packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2 | |
| key: lucee-script-runner-maven-cache | |
| - 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" -DpreCleanup=false -DpostCleanup=false 2>&1 | |
| if ($LASTEXITCODE -ne 0) { | |
| $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DpreCleanup=false -DpostCleanup=false" | |
| $platform = "macos-latest" | |
| 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" | |
| $summary = @() | |
| $summary += "## Platform: $platform | Shell: $shell" | |
| $summary += "### $cmd" | |
| $summary += '```' | |
| $summary += "FAILED: $w / $e" | |
| $summary += $result | |
| $summary += '```' | |
| $summary -join "`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY | |
| } | |
| } | |
| } | |
| - 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" -DpreCleanup=false -DpostCleanup=false 2>&1) | |
| if [ $? -ne 0 ]; then | |
| cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false" | |
| platform="macos-latest" | |
| shell="bash" | |
| echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| done | |
| done | |
| 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`n``` | |
| 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 -DpreCleanup=false -DpostCleanup=false > result.txt 2>&1 | |
| if errorlevel 1 ( | |
| set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false | |
| echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% | |
| echo ### %cmd%>> %GITHUB_STEP_SUMMARY% | |
| echo "```" >> %GITHUB_STEP_SUMMARY% | |
| echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% | |
| type result.txt >> %GITHUB_STEP_SUMMARY% | |
| echo "```" >> %GITHUB_STEP_SUMMARY% | |
| echo.>> %GITHUB_STEP_SUMMARY% | |
| ) | |
| ) | |
| ) | |
| 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" -DpreCleanup=false -DpostCleanup=false 2>&1 | |
| if ($LASTEXITCODE -ne 0) { | |
| $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DpreCleanup=false -DpostCleanup=false" | |
| $platform = "windows-latest" | |
| $shell = "pwsh" | |
| $summary = @() | |
| $summary += "## Platform: $platform | Shell: $shell" | |
| $summary += "### $cmd" | |
| $summary += '```' | |
| $summary += "FAILED: $w / $e" | |
| $summary += $result | |
| $summary += '```' | |
| $summary -join "`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY | |
| } | |
| } | |
| } | |
| 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" -DpreCleanup=false -DpostCleanup=false 2>&1) | |
| if [ $? -ne 0 ]; then | |
| cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false" | |
| platform="windows-latest" | |
| shell="bash" | |
| echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| done | |
| done | |
| working-directory: ${{ github.workspace }} |