45
45
- 'example.env'
46
46
- '.github/workflows/e2e.yml'
47
47
48
- main :
48
+ build :
49
49
needs : changes
50
50
if : ${{ needs.changes.outputs.test-changes == 'true' }}
51
51
74
74
- name : Install dependencies
75
75
run : yarn install --immutable
76
76
77
- - name : Install Playwright Browsers
78
- run : yarn playwright install chromium --with-deps
79
-
80
77
- name : Setup local cache server for Turborepo
81
78
uses : felixmosh/turborepo-gh-artifacts@v3
82
79
with :
@@ -92,17 +89,73 @@ jobs:
92
89
- name : Wait for OpenMRS instance to start
93
90
run : while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/openmrs/login.htm)" != "200" ]]; do sleep 10; done
94
91
92
+ - name : Commit and export Containers
93
+ run : bash e2e/support/github/commit_and_export_images.sh
94
+
95
+ - name : Upload artifact
96
+ uses : actions/upload-artifact@v4
97
+ with :
98
+ name : e2e_release_env_images
99
+ path : e2e_release_env_images.tar.gz
100
+ retention-days : 1
101
+
102
+ run-patient-management-e2e-tests :
103
+ runs-on : ubuntu-latest
104
+ needs : build
105
+ steps :
106
+ - uses : actions/checkout@v4
107
+
108
+ - name : Create Temporary Directory to Download Docker Images
109
+ id : tempdir
110
+ run : echo "tmpdir=$(mktemp -d)" >> "$GITHUB_OUTPUT"
111
+
112
+ - name : Download Docker Images
113
+ uses : actions/download-artifact@v4
114
+ with :
115
+ name : e2e_release_env_images
116
+ path : ${{ steps.tempdir.outputs.tmpdir }}
117
+
118
+ - name : Load Docker Images
119
+ run : |
120
+ gzip -d ${{ steps.tempdir.outputs.tmpdir }}/e2e_release_env_images.tar.gz
121
+ docker load --input ${{ steps.tempdir.outputs.tmpdir }}/e2e_release_env_images.tar
122
+ docker image ls -a
123
+
124
+ - name : Spin up an OpenMRS Instance
125
+ run : docker compose up -d
126
+ working-directory : e2e_test_support_files
127
+
128
+ - name : Checkout to the repo's main branch
129
+ uses : actions/checkout@v4
130
+ with :
131
+ repository : openmrs/openmrs-esm-patient-management
132
+ ref : main
133
+ path : e2e_repo
134
+
135
+ - name : Copy test environment variables
136
+ run : cp example.env .env
137
+ working-directory : e2e_repo
138
+
139
+ - name : Install dependencies
140
+ if : steps.cache.outputs.cache-hit != 'true'
141
+ run : yarn install --immutable
142
+ working-directory : e2e_repo
143
+
144
+ - name : Install Playwright Browsers
145
+ run : npx playwright install chromium --with-deps
146
+ working-directory : e2e_repo
147
+
148
+ - name : Wait for the OpenMRS instance to start
149
+ run : while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/openmrs/login.htm)" != "200" ]]; do sleep 10; done
150
+
95
151
- name : Run E2E tests
96
152
run : yarn playwright test
153
+ working-directory : e2e_repo
97
154
98
- - name : Stop dev server
99
- if : ' !cancelled()'
100
- run : docker stop $(docker ps -a -q)
101
-
102
- - name : Upload report
155
+ - name : Upload Report
103
156
uses : actions/upload-artifact@v4
104
157
if : always()
105
158
with :
106
- name : playwright- report
107
- path : playwright-report/
159
+ name : report-patient-management
160
+ path : e2e_repo/ playwright-report/
108
161
retention-days : 30
0 commit comments