|
| 1 | +name: Smoke (non-dev environments) |
| 2 | + |
| 3 | +# Regression net for discussion #3023 / issues #3029, #3030, #3031: boots the |
| 4 | +# demo app with config/environment.cfm forced to production and testing and |
| 5 | +# asserts non-development request behavior (clean 404s, no stack traces, reload |
| 6 | +# refused without the password) via tools/ci/smoke-env.sh. |
| 7 | +# |
| 8 | +# The setup + server-boot steps are copied verbatim from pr.yml's fast-test job |
| 9 | +# (minus the Playwright/browser-test steps — the probes are plain curl checks). |
| 10 | + |
| 11 | +on: |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - develop |
| 15 | + paths: |
| 16 | + - 'vendor/wheels/**' |
| 17 | + - 'public/**' |
| 18 | + - 'config/**' |
| 19 | + - 'app/**' |
| 20 | + - 'tools/ci/smoke-env.sh' |
| 21 | + - '.github/workflows/smoke-env.yml' |
| 22 | + |
| 23 | +permissions: |
| 24 | + contents: read |
| 25 | + |
| 26 | +jobs: |
| 27 | + smoke: |
| 28 | + name: "Smoke: ${{ matrix.wheels_env }} (Lucee 7)" |
| 29 | + runs-on: ubuntu-latest |
| 30 | + timeout-minutes: 20 |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + wheels_env: [production, testing] |
| 35 | + env: |
| 36 | + LUCLI_VERSION: "0.3.7" |
| 37 | + WHEELS_CI: "true" |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v5 |
| 40 | + |
| 41 | + - name: Set up JDK 21 |
| 42 | + uses: actions/setup-java@v5 |
| 43 | + with: |
| 44 | + distribution: 'temurin' |
| 45 | + java-version: '21' |
| 46 | + |
| 47 | + - name: Install LuCLI |
| 48 | + run: | |
| 49 | + curl -sL "https://github.com/cybersonic/LuCLI/releases/download/v${LUCLI_VERSION}/lucli-${LUCLI_VERSION}-linux" \ |
| 50 | + -o /usr/local/bin/lucli |
| 51 | + chmod +x /usr/local/bin/lucli |
| 52 | + lucli --version |
| 53 | +
|
| 54 | + - name: Create test databases |
| 55 | + run: | |
| 56 | + sudo apt-get update -y && sudo apt-get install -y --no-install-recommends sqlite3 |
| 57 | + sqlite3 wheelstestdb.db "SELECT 1;" |
| 58 | + sqlite3 wheelstestdb_tenant_b.db "SELECT 1;" |
| 59 | +
|
| 60 | + - name: Download SQLite JDBC driver |
| 61 | + run: | |
| 62 | + curl -sL "https://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.50.3.0/sqlite-jdbc-3.50.3.0.jar" \ |
| 63 | + -o /tmp/sqlite-jdbc.jar |
| 64 | +
|
| 65 | + - name: Force ${{ matrix.wheels_env }} environment |
| 66 | + run: | |
| 67 | + sed -i 's/set(environment = "[a-z]*")/set(environment = "${{ matrix.wheels_env }}")/' config/environment.cfm |
| 68 | + grep -n 'set(environment' config/environment.cfm |
| 69 | +
|
| 70 | + - name: Start Lucee server |
| 71 | + run: | |
| 72 | + cp tools/ci/lucee.ci.json lucee.json |
| 73 | +
|
| 74 | + # Start server (downloads Lucee Express on first run) |
| 75 | + nohup lucli server run --port=60007 > /tmp/lucli-server.log 2>&1 & |
| 76 | + echo $! > /tmp/lucli-server.pid |
| 77 | +
|
| 78 | + echo "Waiting for Lucee to start..." |
| 79 | + for i in $(seq 1 120); do |
| 80 | + if curl -s -o /dev/null --connect-timeout 2 --max-time 3 "http://localhost:60007/" 2>/dev/null; then |
| 81 | + echo "Lucee is up (attempt ${i})" |
| 82 | + break |
| 83 | + fi |
| 84 | + if ! kill -0 $(cat /tmp/lucli-server.pid) 2>/dev/null; then |
| 85 | + echo "::error::LuCLI server process died" |
| 86 | + cat /tmp/lucli-server.log |
| 87 | + exit 1 |
| 88 | + fi |
| 89 | + sleep 2 |
| 90 | + done |
| 91 | +
|
| 92 | + - name: Install SQLite JDBC into Lucee |
| 93 | + run: | |
| 94 | + # Find where LuCLI placed the Lucee Express lib directory |
| 95 | + LUCEE_LIB=$(find ~/.lucli/express -path "*/lib/ext" -type d 2>/dev/null | head -1) |
| 96 | + if [ -z "$LUCEE_LIB" ]; then |
| 97 | + LUCEE_LIB=$(find ~/.lucli/express -maxdepth 2 -name "lib" -type d 2>/dev/null | head -1) |
| 98 | + fi |
| 99 | + if [ -n "$LUCEE_LIB" ]; then |
| 100 | + cp /tmp/sqlite-jdbc.jar "$LUCEE_LIB/" |
| 101 | + echo "SQLite JDBC installed to: $LUCEE_LIB" |
| 102 | + else |
| 103 | + echo "::error::Could not find Lucee lib directory" |
| 104 | + find ~/.lucli/express -type d | head -20 |
| 105 | + exit 1 |
| 106 | + fi |
| 107 | +
|
| 108 | + # Stop server fully and restart to pick up the new JDBC driver |
| 109 | + kill $(cat /tmp/lucli-server.pid) 2>/dev/null || true |
| 110 | + lucli server stop 2>/dev/null || true |
| 111 | + # Wait for port to be freed |
| 112 | + for i in $(seq 1 15); do |
| 113 | + if ! curl -s -o /dev/null --connect-timeout 1 "http://localhost:60007/" 2>/dev/null; then |
| 114 | + break |
| 115 | + fi |
| 116 | + sleep 1 |
| 117 | + done |
| 118 | + # Also kill any lingering java processes on the port |
| 119 | + fuser -k 60007/tcp 2>/dev/null || true |
| 120 | + sleep 2 |
| 121 | +
|
| 122 | + nohup lucli server run --port=60007 --force > /tmp/lucli-server.log 2>&1 & |
| 123 | + echo $! > /tmp/lucli-server.pid |
| 124 | +
|
| 125 | + echo "Waiting for Lucee to restart..." |
| 126 | + for i in $(seq 1 60); do |
| 127 | + if curl -s -o /dev/null --connect-timeout 2 --max-time 3 "http://localhost:60007/" 2>/dev/null; then |
| 128 | + echo "Lucee restarted with SQLite JDBC" |
| 129 | + break |
| 130 | + fi |
| 131 | + sleep 2 |
| 132 | + done |
| 133 | +
|
| 134 | + - name: Run smoke probes |
| 135 | + run: | |
| 136 | + BASE_URL="http://localhost:60007" SMOKE_ENV="${{ matrix.wheels_env }}" bash tools/ci/smoke-env.sh |
| 137 | +
|
| 138 | + - name: Debug server logs |
| 139 | + if: failure() |
| 140 | + run: cat /tmp/lucli-server.log 2>/dev/null || true |
| 141 | + |
| 142 | + - name: Stop server |
| 143 | + if: always() |
| 144 | + run: | |
| 145 | + if [ -f /tmp/lucli-server.pid ]; then |
| 146 | + kill $(cat /tmp/lucli-server.pid) 2>/dev/null || true |
| 147 | + fi |
| 148 | + lucli server stop 2>/dev/null || true |
0 commit comments