|
| 1 | +name: Webroot Handling Matrix |
| 2 | +on: |
| 3 | + push: |
| 4 | + pull_request: |
| 5 | + workflow_dispatch: |
| 6 | +concurrency: |
| 7 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 8 | + cancel-in-progress: true |
| 9 | +jobs: |
| 10 | + macos-bash: |
| 11 | + name: MacOS Bash |
| 12 | + runs-on: macos-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + - name: Cache Maven packages |
| 16 | + uses: actions/cache@v4 |
| 17 | + with: |
| 18 | + path: ~/.m2/repository |
| 19 | + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 20 | + restore-keys: | |
| 21 | + ${{ runner.os }}-maven- |
| 22 | + - name: Set up Java |
| 23 | + uses: actions/setup-java@v4 |
| 24 | + with: |
| 25 | + distribution: 'temurin' |
| 26 | + java-version: '21' |
| 27 | + - name: Run all webroot/execute combinations |
| 28 | + shell: bash |
| 29 | + env: |
| 30 | + LUCEE_VERSION_QUERY: 7/all/zero |
| 31 | + working-directory: ${{ github.workspace }}/tests/webroot |
| 32 | + run: | |
| 33 | + luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" |
| 34 | + pwd |
| 35 | + webroots=( '.' "${{ github.workspace }}/tests/webroot" ) |
| 36 | + executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) |
| 37 | + failed=0 |
| 38 | + for w in "${webroots[@]}"; do |
| 39 | + for e in "${executes[@]}"; do |
| 40 | + echo "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" |
| 41 | + ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" |
| 42 | + if [ $? -ne 0 ]; then |
| 43 | + failed=1 |
| 44 | + platform="macos-latest" |
| 45 | + shell="bash" |
| 46 | + echo -e "## Platform: $platform | Shell: $shell\n(pwd): $(pwd)\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" |
| 47 | + fi |
| 48 | + done |
| 49 | + done |
| 50 | + exit $failed |
| 51 | + ubuntu-bash: |
| 52 | + name: Ubuntu Bash |
| 53 | + runs-on: ubuntu-latest |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v4 |
| 56 | + - name: Cache Maven packages |
| 57 | + uses: actions/cache@v4 |
| 58 | + with: |
| 59 | + path: ~/.m2/repository |
| 60 | + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 61 | + restore-keys: | |
| 62 | + ${{ runner.os }}-maven- |
| 63 | + - name: Set up Java |
| 64 | + uses: actions/setup-java@v4 |
| 65 | + with: |
| 66 | + distribution: 'temurin' |
| 67 | + java-version: '21' |
| 68 | + - name: Run all webroot/execute combinations |
| 69 | + shell: bash |
| 70 | + env: |
| 71 | + LUCEE_VERSION_QUERY: 7/all/zero |
| 72 | + working-directory: ${{ github.workspace }}/tests/webroot |
| 73 | + run: | |
| 74 | + luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" |
| 75 | + pwd |
| 76 | + webroots=( '.' "${{ github.workspace }}/tests/webroot" ) |
| 77 | + executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) |
| 78 | + failed=0 |
| 79 | + for w in "${webroots[@]}"; do |
| 80 | + for e in "${executes[@]}"; do |
| 81 | + echo "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" |
| 82 | + ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" |
| 83 | + if [ $? -ne 0 ]; then |
| 84 | + failed=1 |
| 85 | + platform="ubuntu-latest" |
| 86 | + shell="bash" |
| 87 | + echo -e "## Platform: $platform | Shell: $shell\n(pwd): $(pwd)\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" |
| 88 | + fi |
| 89 | + done |
| 90 | + done |
| 91 | + exit $failed |
| 92 | +
|
| 93 | + windows-cmd: |
| 94 | + name: Windows CMD |
| 95 | + runs-on: windows-latest |
| 96 | + steps: |
| 97 | + - uses: actions/checkout@v4 |
| 98 | + - name: Cache Maven packages |
| 99 | + uses: actions/cache@v4 |
| 100 | + with: |
| 101 | + path: ~/.m2/repository |
| 102 | + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 103 | + restore-keys: | |
| 104 | + ${{ runner.os }}-maven- |
| 105 | + - name: Set up Java |
| 106 | + uses: actions/setup-java@v4 |
| 107 | + with: |
| 108 | + distribution: 'temurin' |
| 109 | + java-version: '21' |
| 110 | + - name: Run all webroot/execute combinations |
| 111 | + shell: cmd |
| 112 | + env: |
| 113 | + LUCEE_VERSION_QUERY: 7/all/zero |
| 114 | + working-directory: ${{ github.workspace }}/tests/webroot |
| 115 | + run: | |
| 116 | + @echo off |
| 117 | + setlocal enabledelayedexpansion |
| 118 | + for %%w in (.) do ( |
| 119 | + for %%e in (index.cfm test.cfm sub\test.cfm) do ( |
| 120 | + echo %%w / %%e |
| 121 | + ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% |
| 122 | + if errorlevel 1 ( |
| 123 | + set cmd=ant -buildfile=build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% |
| 124 | + echo FAILED: %%w / %%e: !cmd!>> %GITHUB_STEP_SUMMARY% |
| 125 | + echo(>> %GITHUB_STEP_SUMMARY% |
| 126 | + exit /b 1 |
| 127 | + ) |
| 128 | + ) |
| 129 | + ) |
| 130 | + for %%w in ("%GITHUB_WORKSPACE%\tests\webroot") do ( |
| 131 | + for %%e in (index.cfm test.cfm sub/test.cfm) do ( |
| 132 | + ant -buildfile=..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% |
| 133 | + if errorlevel 1 ( |
| 134 | + set cmd=ant -buildfile=build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% |
| 135 | + echo FAILED: %%w / %%e: !cmd!>> %GITHUB_STEP_SUMMARY% |
| 136 | + echo(>> %GITHUB_STEP_SUMMARY% |
| 137 | + exit /b 1 |
| 138 | + ) |
| 139 | + ) |
| 140 | + ) |
| 141 | +
|
| 142 | + endlocal |
| 143 | + windows-pwsh: |
| 144 | + name: Windows PowerShell |
| 145 | + runs-on: windows-latest |
| 146 | + steps: |
| 147 | + - uses: actions/checkout@v4 |
| 148 | + - name: Cache Maven packages |
| 149 | + uses: actions/cache@v4 |
| 150 | + with: |
| 151 | + path: ~/.m2/repository |
| 152 | + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 153 | + restore-keys: | |
| 154 | + ${{ runner.os }}-maven- |
| 155 | + - name: Set up Java |
| 156 | + uses: actions/setup-java@v4 |
| 157 | + with: |
| 158 | + distribution: 'temurin' |
| 159 | + java-version: '21' |
| 160 | + - name: Run all webroot/execute combinations |
| 161 | + shell: pwsh |
| 162 | + env: |
| 163 | + LUCEE_VERSION_QUERY: 7/all/zero |
| 164 | + working-directory: ${{ github.workspace }}/tests/webroot |
| 165 | + run: | |
| 166 | + $webroots = @('.', "${{ github.workspace }}\tests\webroot") |
| 167 | + pwd |
| 168 | + $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') |
| 169 | + foreach ($w in $webroots) { |
| 170 | + foreach ($e in $executes) { |
| 171 | + $luceeVersionQuery = $env:LUCEE_VERSION_QUERY |
| 172 | + $cmd = "ant -buildfile=../../build.xml `"-Dwebroot=$w`" `"-Dexecute=$e`" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" |
| 173 | + Write-Host $cmd |
| 174 | + $LASTEXITCODE = 0 |
| 175 | + iex $cmd |
| 176 | + if ($LASTEXITCODE -ne 0) { |
| 177 | + $cmd = "ant -buildfile=../../build.xml `"-Dwebroot=$w`" `"-Dexecute=$e`" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" |
| 178 | + $platform = "windows-latest" |
| 179 | + $shell = "pwsh" |
| 180 | + $summary = @() |
| 181 | + $summary += "## Platform: $platform | Shell: $shell" |
| 182 | + $summary += "(pwd): $(pwd)" |
| 183 | + $summary += "### $cmd" |
| 184 | + $summary += "FAILED: $w / $e" |
| 185 | + $summary -join "`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY |
| 186 | + } |
| 187 | + } |
| 188 | + } |
| 189 | + windows-bash: |
| 190 | + name: Windows Bash |
| 191 | + runs-on: windows-latest |
| 192 | + steps: |
| 193 | + - uses: actions/checkout@v4 |
| 194 | + - name: Cache Maven packages |
| 195 | + uses: actions/cache@v4 |
| 196 | + with: |
| 197 | + path: ~/.m2/repository |
| 198 | + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 199 | + restore-keys: | |
| 200 | + ${{ runner.os }}-maven- |
| 201 | + - name: Set up Java |
| 202 | + uses: actions/setup-java@v4 |
| 203 | + with: |
| 204 | + distribution: 'temurin' |
| 205 | + java-version: '21' |
| 206 | + - name: Run all webroot/execute combinations |
| 207 | + shell: bash |
| 208 | + env: |
| 209 | + LUCEE_VERSION_QUERY: 7/all/zero |
| 210 | + working-directory: ${{ github.workspace }}/tests/webroot |
| 211 | + run: | |
| 212 | + luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" |
| 213 | + webroots=( '.' "${{ github.workspace }}/tests/webroot" ) |
| 214 | + executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) |
| 215 | + failed=0 |
| 216 | + for w in "${webroots[@]}"; do |
| 217 | + for e in "${executes[@]}"; do |
| 218 | + echo "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" |
| 219 | + ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" |
| 220 | + if [ $? -ne 0 ]; then |
| 221 | + failed=1 |
| 222 | + platform="windows-latest" |
| 223 | + shell="bash" |
| 224 | + echo -e "## Platform: $platform | Shell: $shell\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" |
| 225 | + fi |
| 226 | + done |
| 227 | + done |
| 228 | + exit $failed |
0 commit comments