-
Notifications
You must be signed in to change notification settings - Fork 40
64 lines (55 loc) · 2.13 KB
/
Copy pathwebsite-test-live-prod.yml
File metadata and controls
64 lines (55 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Live Site Test (idptools.com)
# Runs the full Selenium suite against the DEPLOYED PROD site
# (https://idptools.com), using a throwaway Keycloak spun up locally (browser
# reaches it at http://localhost:8080 via host networking). Same mechanism as
# the test-site live test (docker-compose-live-tests.yml), pointed at prod via
# LIVE_DEBUGGER_BASE_URL / LIVE_CONFIG_FILE.
#
# Runs automatically after a successful prod deploy, plus nightly and on demand.
#
# NOTE: the workflow_run trigger only fires from this file on the DEFAULT branch
# (master).
on:
# After the prod deploy finishes.
workflow_run:
workflows: ["Deploy Static Site (idptools.com)"]
types: [completed]
workflow_dispatch:
# Nightly, staggered after the test-site live run (11:00 UTC).
schedule:
- cron: '0 12 * * *'
permissions:
contents: read
jobs:
live-test:
runs-on: ubuntu-latest
# For a post-deploy (workflow_run) trigger, only run if the deploy
# succeeded. Manual dispatch and the nightly schedule always run.
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v7
- name: Install docker-compose
uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: '5.2.0'
- name: Run Selenium suite against the live PROD site
run: |
sudo LIVE_DEBUGGER_BASE_URL=https://idptools.com \
LIVE_CONFIG_FILE=./env/prod.js \
docker compose -f docker-compose-live-tests.yml \
up --build --abort-on-container-exit --exit-code-from tests
- name: Tear down the stack
if: always()
run: sudo docker compose -f docker-compose-live-tests.yml down
- name: Normalize report permissions
if: always()
run: sudo chown -R "$(id -u):$(id -g)" tests/report || true
- name: Upload test report
if: always()
uses: actions/upload-artifact@v7
with:
name: live-test-report-prod
path: tests/report/latest
if-no-files-found: warn
retention-days: 30