Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/deploy-cloudflare-bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,22 @@ jobs:
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
run: node tests/deployment-smoke.mjs "$DEPLOYMENT_URL" noindex

- name: Validate stable bridge alias
run: node tests/deployment-smoke.mjs https://secure-tools-web-bridge.pages.dev noindex
- name: Validate stable deployment aliases
shell: bash
run: |
smoke_with_retry() {
local url="$1"
local indexing="$2"

for attempt in 1 2 3 4 5 6; do
if node tests/deployment-smoke.mjs "$url" "$indexing"; then
return 0
fi
[[ "$attempt" -lt 6 ]] || return 1
echo "Waiting for Cloudflare alias propagation (attempt $attempt of 6)."
sleep 10
done
}

- name: Validate tools custom domain
run: node tests/deployment-smoke.mjs https://tools.securetools.app indexable
smoke_with_retry https://secure-tools-web-bridge.pages.dev noindex
smoke_with_retry https://tools.securetools.app indexable
7 changes: 5 additions & 2 deletions tests/cloudflare-bridge.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ assert.match(workflow, /\[\[ ! -e "\$BRIDGE_DIRECTORY\/_redirects" \]\]/);
assert.match(workflow, /find "\$BRIDGE_DIRECTORY" -name index\.html -type f \| wc -l\)" -eq 20/);
assert.doesNotMatch(workflow, /securetools\.app\/tools/);
assert.match(workflow, /node tests\/deployment-smoke\.mjs "\$DEPLOYMENT_URL" noindex/);
assert.match(workflow, /node tests\/deployment-smoke\.mjs https:\/\/secure-tools-web-bridge\.pages\.dev noindex/);
assert.match(workflow, /node tests\/deployment-smoke\.mjs https:\/\/tools\.securetools\.app indexable/);
assert.match(workflow, /smoke_with_retry https:\/\/secure-tools-web-bridge\.pages\.dev noindex/);
assert.match(workflow, /smoke_with_retry https:\/\/tools\.securetools\.app indexable/);
assert.match(workflow, /for attempt in 1 2 3 4 5 6;/);
assert.match(workflow, /Waiting for Cloudflare alias propagation/);
assert.match(workflow, /sleep 10/);
assert.doesNotMatch(workflow, /node tests\/deployment-smoke\.mjs https:\/\/securetools\.app/);

const deploymentSmoke = fs.readFileSync("tests/deployment-smoke.mjs", "utf8");
Expand Down
Loading