-
Notifications
You must be signed in to change notification settings - Fork 260
103 lines (88 loc) · 3.11 KB
/
template-deploy.yaml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: "test"
on:
workflow_call:
inputs:
compose_args:
description: arguments supplied to docker compose
required: true
type: string
run_e2e_tests:
description: runs playwright tests
required: true
type: boolean
directory:
description: directory to run the tests
required: false
type: string
run_single_test:
description: runs a single test
required: false
type: string
jobs:
test_compose_deploy:
name: Test deploying camunda platform on docker compose
runs-on: ubuntu-latest
steps:
- name: disable and stop mono-xsp4.service
run: |
sudo systemctl stop mono-xsp4.service || true
sudo systemctl disable mono-xsp4.service || true
sudo killall mono || true
sudo killall xsp4 || true
- uses: actions/checkout@v4
- name: Login to private registry
if: ${{ inputs.directory != 'docker-compose/camunda-8.6' }}
run: >-
echo '${{ secrets.CI_DISTRIBUTION_REGISTRY_PASSWORD }}' | docker login -u ci-distribution --password-stdin registry.camunda.cloud
- name: Bring up containers
working-directory: ${{ inputs.directory || '.' }}
run: >-
docker compose ${{ inputs.compose_args }}
up
--quiet-pull
-d
- name: "Wait until (health: starting) goes away"
run: >-
while [ "$(docker container ls | grep "health: starting")" != "" ];
do
sleep 5;
done
- name: Print container status
id: container_status
run: >-
docker container ls --format "table {{.Image}}\t{{.Status}}" | tee status
- name: Check to see if all containers are healthy
run: >-
test
"$(cat status |
grep
-e "unhealthy"
-e "health: starting")"
=
""
- uses: actions/setup-node@v4
if: ${{ inputs.run_e2e_tests || inputs.run_single_test }}
with:
node-version: 18
- name: Install dependencies
if: ${{ inputs.run_e2e_tests || inputs.run_single_test }}
run: npm ci
working-directory: ./e2e_tests
- name: Install Playwright Browsers
if: ${{ inputs.run_e2e_tests || inputs.run_single_test }}
run: npx playwright install --with-deps
working-directory: ./e2e_tests
- name: Run Playwright tests
if: ${{ inputs.run_e2e_tests && inputs.run_single_test == '' }}
run: npx playwright test
working-directory: ./e2e_tests
- name: Run single Playwright test '${{ inputs.run_single_test }}'
if: ${{ inputs.run_e2e_tests && inputs.run_single_test }}
run: npx playwright test ${{ inputs.run_single_test }}
working-directory: ./e2e_tests
- uses: actions/upload-artifact@v4
if: ${{ inputs.run_e2e_tests || inputs.run_single_test }}
with:
name: playwright-report${{ inputs.run_single_test && '-single-test' || '' }}
path: e2e_tests/playwright-report/
retention-days: 30