|
13 | 13 | JINKS_IMAGE: ghcr.io/eeditiones/jinks |
14 | 14 |
|
15 | 15 | jobs: |
16 | | - generate-and-test-apps: |
17 | | - name: Generate and test Demo Apps |
| 16 | + generate-apps: |
| 17 | + name: Generate Demo Apps |
18 | 18 | runs-on: ubuntu-latest |
19 | 19 |
|
20 | 20 | steps: |
@@ -82,40 +82,170 @@ jobs: |
82 | 82 | run: | |
83 | 83 | jinks create -c tp_config.json |
84 | 84 |
|
85 | | - - name: Generate tp-serafin app |
86 | | - working-directory: demo |
| 85 | + # - name: Generate tp-serafin app |
| 86 | + # working-directory: demo |
| 87 | + # run: | |
| 88 | + # jinks create -c ser_config.json |
| 89 | + |
| 90 | + # - name: Generate tp-workbench app |
| 91 | + # working-directory: demo |
| 92 | + # run: | |
| 93 | + # jinks create -c workbench_config.json |
| 94 | + |
| 95 | + - name: Tag docker container for reusing in next steps |
87 | 96 | run: | |
88 | | - jinks create -c ser_config.json |
| 97 | + docker image commit jinks-server temp/jinks-server:$GITHUB_SHA |
| 98 | + mkdir -p path/to/artifacts |
| 99 | + docker save temp/jinks-server:$GITHUB_SHA > path/to/artifacts/docker-image.tar |
89 | 100 |
|
90 | | - - name: Generate tp-workbench app |
91 | | - working-directory: demo |
| 101 | + run-tests-for-tei-publisher: |
| 102 | + name: Run tests on tei publisher |
| 103 | + runs-on: ubuntu-latest |
| 104 | + needs: generate-apps |
| 105 | + steps: |
| 106 | + - name: Checkout |
| 107 | + uses: actions/checkout@v2 |
| 108 | + - name: Retrieve saved Docker image |
| 109 | + uses: actions/download-artifact@v2 |
| 110 | + with: |
| 111 | + name: docker-artifact |
| 112 | + path: path/to/artifacts |
| 113 | + - name: Docker load |
92 | 114 | run: | |
93 | | - jinks create -c workbench_config.json |
| 115 | + cd path/to/artifacts |
| 116 | + docker load < docker-image.tar |
| 117 | +
|
| 118 | + - name: Start jinks container |
| 119 | + run: | |
| 120 | + docker run -d \ |
| 121 | + --name jinks-server \ |
| 122 | + -p 8080:8080 \ |
| 123 | + tmp/jinks-server:$GITHUB_SHA |
| 124 | +
|
| 125 | + - name: Wait for server to be ready |
| 126 | + run: | |
| 127 | + echo "Waiting for eXist-db to start..." |
| 128 | + timeout=120 |
| 129 | + elapsed=0 |
| 130 | + while [ $elapsed -lt $timeout ]; do |
| 131 | + if curl -s -f http://localhost:8080/exist/apps/jinks/api/configurations > /dev/null 2>&1; then |
| 132 | + echo "Server is ready!" |
| 133 | + exit 0 |
| 134 | + fi |
| 135 | + echo "Still waiting... ($elapsed seconds)" |
| 136 | + sleep 5 |
| 137 | + elapsed=$((elapsed + 5)) |
| 138 | + done |
| 139 | + echo "Timeout waiting for server" |
| 140 | + exit 1 |
94 | 141 |
|
95 | | - - name: Verify deployed apps |
96 | | - run: jinks list |
97 | 142 |
|
98 | 143 | - name: Run Cypress tests on tei-publisher |
99 | 144 | uses: ./.github/actions/cypress-test-for-demo-app |
100 | 145 | with: |
101 | 146 | app-name: tei-publisher |
102 | 147 |
|
103 | | - - name: Run Cypress tests on tp-serafin |
104 | | - uses: ./.github/actions/cypress-test-for-demo-app |
| 148 | + - name: Stop jinks container |
| 149 | + if: always() |
| 150 | + run: docker stop jinks-server || true |
| 151 | + |
| 152 | + run-tests-for-tp-workbench: |
| 153 | + name: Run tests on workbench |
| 154 | + runs-on: ubuntu-latest |
| 155 | + needs: generate-apps |
| 156 | + steps: |
| 157 | + - name: Checkout |
| 158 | + uses: actions/checkout@v2 |
| 159 | + - name: Retrieve saved Docker image |
| 160 | + uses: actions/download-artifact@v2 |
105 | 161 | with: |
106 | | - app-name: tp-serafin |
| 162 | + name: docker-artifact |
| 163 | + path: path/to/artifacts |
| 164 | + - name: Docker load |
| 165 | + run: | |
| 166 | + cd path/to/artifacts |
| 167 | + docker load < docker-image.tar |
| 168 | +
|
| 169 | + - name: Start jinks container |
| 170 | + run: | |
| 171 | + docker run -d \ |
| 172 | + --name jinks-server \ |
| 173 | + -p 8080:8080 \ |
| 174 | + tmp/jinks-server:$GITHUB_SHA |
| 175 | +
|
| 176 | + - name: Wait for server to be ready |
| 177 | + run: | |
| 178 | + echo "Waiting for eXist-db to start..." |
| 179 | + timeout=120 |
| 180 | + elapsed=0 |
| 181 | + while [ $elapsed -lt $timeout ]; do |
| 182 | + if curl -s -f http://localhost:8080/exist/apps/jinks/api/configurations > /dev/null 2>&1; then |
| 183 | + echo "Server is ready!" |
| 184 | + exit 0 |
| 185 | + fi |
| 186 | + echo "Still waiting... ($elapsed seconds)" |
| 187 | + sleep 5 |
| 188 | + elapsed=$((elapsed + 5)) |
| 189 | + done |
| 190 | + echo "Timeout waiting for server" |
| 191 | + exit 1 |
| 192 | +
|
107 | 193 |
|
108 | | - - name: Run Cypress tests on tp-workbench |
| 194 | + - name: Run Cypress tests on tei-publisher |
109 | 195 | uses: ./.github/actions/cypress-test-for-demo-app |
110 | 196 | with: |
111 | 197 | app-name: tp-workbench |
112 | 198 |
|
113 | | - - name: Upload XAR artifacts |
114 | | - uses: actions/upload-artifact@v6 |
| 199 | + - name: Stop jinks container |
| 200 | + if: always() |
| 201 | + run: docker stop jinks-server || true |
| 202 | + |
| 203 | + run-tests-for-tp-serafin: |
| 204 | + name: Run tests on serafin |
| 205 | + runs-on: ubuntu-latest |
| 206 | + needs: generate-apps |
| 207 | + steps: |
| 208 | + - name: Checkout |
| 209 | + uses: actions/checkout@v2 |
| 210 | + - name: Retrieve saved Docker image |
| 211 | + uses: actions/download-artifact@v2 |
| 212 | + with: |
| 213 | + name: docker-artifact |
| 214 | + path: path/to/artifacts |
| 215 | + - name: Docker load |
| 216 | + run: | |
| 217 | + cd path/to/artifacts |
| 218 | + docker load < docker-image.tar |
| 219 | +
|
| 220 | + - name: Start jinks container |
| 221 | + run: | |
| 222 | + docker run -d \ |
| 223 | + --name jinks-server \ |
| 224 | + -p 8080:8080 \ |
| 225 | + tmp/jinks-server:$GITHUB_SHA |
| 226 | +
|
| 227 | + - name: Wait for server to be ready |
| 228 | + run: | |
| 229 | + echo "Waiting for eXist-db to start..." |
| 230 | + timeout=120 |
| 231 | + elapsed=0 |
| 232 | + while [ $elapsed -lt $timeout ]; do |
| 233 | + if curl -s -f http://localhost:8080/exist/apps/jinks/api/configurations > /dev/null 2>&1; then |
| 234 | + echo "Server is ready!" |
| 235 | + exit 0 |
| 236 | + fi |
| 237 | + echo "Still waiting... ($elapsed seconds)" |
| 238 | + sleep 5 |
| 239 | + elapsed=$((elapsed + 5)) |
| 240 | + done |
| 241 | + echo "Timeout waiting for server" |
| 242 | + exit 1 |
| 243 | +
|
| 244 | +
|
| 245 | + - name: Run Cypress tests on tei-publisher |
| 246 | + uses: ./.github/actions/cypress-test-for-demo-app |
115 | 247 | with: |
116 | | - name: demo-apps-xars |
117 | | - path: demo/*.xar |
118 | | - retention-days: 30 |
| 248 | + app-name: tp-serafin |
119 | 249 |
|
120 | 250 | - name: Stop jinks container |
121 | 251 | if: always() |
|
0 commit comments