Skip to content

Commit 8984c40

Browse files
authored
Allow Codecov to fail in CI without failing the pipeline. (#2477)
1 parent e5a43dc commit 8984c40

29 files changed

Lines changed: 621 additions & 188 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ VORTEX_NOTIFY_WEBHOOK_URL=
374374

375375
#;< DB_DOWNLOAD_SOURCE_URL
376376
# URL of the database used for demonstration with URL database download type.
377-
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/25.4.0/db_d11.demo.sql
377+
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/1.37.0/db.demo.sql
378378
#;> DB_DOWNLOAD_SOURCE_URL
379379

380380
#;< MIGRATION

.github/workflows/build-test-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ jobs:
488488
- name: Upload coverage report to Codecov
489489
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
490490
if: ${{ (matrix.instance == 0 || strategy.job-total == 1) && env.CODECOV_TOKEN != '' }}
491+
continue-on-error: true
491492
with:
492493
directory: .logs/coverage
493494
fail_ci_if_error: true

.github/workflows/vortex-test-common.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ jobs:
110110

111111
- name: Upload coverage report to Codecov
112112
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
113+
continue-on-error: true
113114
with:
114115
directory: /tmp/.vortex-coverage-html
115116
fail_ci_if_error: false
@@ -216,6 +217,7 @@ jobs:
216217

217218
- name: Upload coverage report to Codecov
218219
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
220+
continue-on-error: true
219221
with:
220222
directory: /tmp/.vortex-coverage-html
221223
fail_ci_if_error: false

.github/workflows/vortex-test-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108

109109
- name: Upload coverage report to Codecov
110110
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
111+
continue-on-error: true
111112
with:
112113
files: .vortex/docs/.logs/cobertura.xml
113114
fail_ci_if_error: true

.github/workflows/vortex-test-installer.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080

8181
- name: Upload coverage report to Codecov
8282
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
83+
continue-on-error: true
8384
with:
8485
files: .vortex/installer/.logs/cobertura.xml
8586
fail_ci_if_error: true

.vortex/docs/content/contributing/maintenance/template.mdx

Lines changed: 36 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -234,188 +234,58 @@ bats .vortex/tests/bats/deploy.bats
234234

235235
## Updating test assets
236236

237-
There are *demo* and *test* database dumps captured as *files* and *container images*.
237+
There are *demo* and *test* database dumps captured as *files* and *container
238+
images*. All flows are automated by `.vortex/tests/update-test-assets`, which
239+
prints every shell command it runs.
238240

239-
### Updating *demo* database dump *file*
240-
241-
<details>
242-
<summary>Show instructions</summary>
243-
244-
1. Run fresh build of **Vortex** locally:
245-
```shell
246-
rm .data/db.sql || true
247-
VORTEX_PROVISION_TYPE=profile VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 AHOY_CONFIRM_RESPONSE=1 ahoy build
248-
```
249-
2. Update content and config:
250-
```shell
251-
ahoy cli
252-
253-
drush eval "Drupal::entityTypeManager()->getStorage('node')->create([
254-
'type' => 'page',
255-
'title' => 'Welcome to the demo site!',
256-
'body' => [
257-
'value' => '<p>This demo page is sourced from the Vortex database dump file to demonstrate database importing capabilities.</p>',
258-
'format' => 'basic_html',
259-
],
260-
])->save();"
261-
262-
drush config:set system.site page.front "/node/1" -y
263-
drush sql:query "SHOW TABLES LIKE 'cache_%'" | xargs -I{} drush sql:query "TRUNCATE TABLE {}" && drush sql:query "TRUNCATE TABLE watchdog"
264-
265-
exit
266-
267-
```
268-
3. Export DB:
269-
```shell
270-
ahoy export-db db.demo.sql
271-
```
272-
4. Upload `db.demo.sql` to the latest release as an asset and name it `db_d11.demo.sql`.
273-
274-
</details>
275-
276-
### Updating *demo* database *container image*
277-
278-
<details>
279-
<summary>Show instructions</summary>
280-
281-
1. Run fresh build of **Vortex** locally:
282241
```shell
283-
rm .data/db.sql || true
284-
VORTEX_PROVISION_TYPE=profile VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 AHOY_CONFIRM_RESPONSE=1 ahoy build
242+
php .vortex/tests/update-test-assets [mode] [--tag <tag>]
285243
```
286-
2. Update content and config:
287-
```shell
288-
ahoy cli
289244

290-
drush eval "Drupal::entityTypeManager()->getStorage('node')->create([
291-
'type' => 'page',
292-
'title' => 'Welcome to the demo site!',
293-
'body' => [
294-
'value' => '<p>This demo page is sourced from the Vortex database container image to demonstrate database importing capabilities.</p>',
295-
'format' => 'basic_html',
296-
],
297-
])->save();"
245+
Without arguments, runs `all` for a full refresh. Default tag is `latest`.
298246

299-
drush config:set system.site page.front "/node/1" -y
300-
drush sql:query "SHOW TABLES LIKE 'cache_%'" | xargs -I{} drush sql:query "TRUNCATE TABLE {}" && drush sql:query "TRUNCATE TABLE watchdog"
247+
### Modes
301248

302-
exit
249+
| Mode | What it does | Follow-up |
250+
| --- | --- | --- |
251+
| `demo-dump` | Builds the demo profile in-place; exports `.data/db.demo.sql`. | Upload as `db.demo.sql` to the latest GitHub release. |
252+
| `demo-image` | Builds the demo profile in-place; pushes `drevops/vortex-dev-mariadb-drupal-data-demo-11.x:<tag>`. | None. |
253+
| `test-dump` | Installs Vortex into `/tmp/star-wars`; builds; exports `/tmp/star-wars/.data/db.test.sql`. | Upload as `db_d11.test.sql` to the latest GitHub release. |
254+
| `test-image` | Installs Vortex into `/tmp/star-wars`; builds; pushes `drevops/vortex-dev-mariadb-drupal-data-test-11.x:<tag>`. | None. |
255+
| `destination-images` | Tags and pushes the local demo image to the didi destination tags (`vortex-dev-database-ii`, `vortex-dev-didi-database-fi`). | None. |
256+
| `all` | Optimised full refresh: builds the demo stack once for both demo modes and the test stack once for both test modes (2 stack builds instead of 4), then pushes images and tags destination images. Default when no mode is given. | Upload both dump files as above. |
303257

304-
```
305-
3. Export DB:
306-
```shell
307-
ahoy export-db db.demo_image.sql
258+
### Options
308259

309-
# Update the collation to avoid issues with MariaDB 10.5+:
310-
sed -i '' 's/utf8mb4_0900_ai_ci/utf8mb4_general_ci/g' .data/db.demo_image.sql
311-
```
312-
4. Seed the database container image:
313-
```shell
314-
curl -LO https://github.com/drevops/mariadb-drupal-data/releases/latest/download/seed.sh
315-
chmod +x seed.sh
316-
./seed.sh .data/db.demo_image.sql drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest
317-
```
318-
319-
</details>
320-
321-
### Updating *test* database dump *file*
322-
323-
<details>
324-
<summary>Show instructions</summary>
260+
| Option | Description |
261+
| --- | --- |
262+
| `--tag <tag>` | Image tag for image modes. Default: `latest`. Also accepts `--tag=<tag>`. |
325263

326-
1. Run a fresh install of **Vortex** into a new directory and name the project `Star Wars`:
327-
```shell
328-
mkdir /tmp/star-wars
329-
VORTEX_INSTALLER_TEMPLATE_REPO="$(pwd)" .vortex/installer/installer.php /tmp/star-wars --no-interaction
330-
cd /tmp/star-wars
331-
```
332-
2. Run fresh build of **Vortex** locally:
333-
```shell
334-
rm .data/db.sql || true
335-
VORTEX_PROVISION_TYPE=profile AHOY_CONFIRM_RESPONSE=1 ahoy build
336-
```
337-
3. Update content and config:
338-
```shell
339-
ahoy cli
340-
341-
drush eval "Drupal::entityTypeManager()->getStorage('node')->create([
342-
'type' => 'page',
343-
'title' => 'Welcome to the test site!',
344-
'body' => [
345-
'value' => '<p>This test page is sourced from the Vortex database dump file to demonstrate database importing capabilities.</p>',
346-
'format' => 'basic_html',
347-
],
348-
])->save();"
349-
350-
drush config:set system.site page.front "/node/1" -y
351-
drush sql:query "SHOW TABLES LIKE 'cache_%'" | xargs -I{} drush sql:query "TRUNCATE TABLE {}" && drush sql:query "TRUNCATE TABLE watchdog"
352-
353-
exit
264+
### Requirements
354265

355-
```
356-
4. Export DB:
357-
```shell
358-
ahoy export-db db.test.sql
359-
```
360-
5. Upload `db.test.sql` to the latest release as an asset and name it `db_d11.test.sql`.
266+
- `docker`, `ahoy`, `curl`, `sed`, `php` available on `PATH`.
267+
- A Docker Hub session with push permission to `drevops/` for any image mode.
361268

362-
</details>
269+
### Caveats
363270

364-
### Updating *test* database *container image*
271+
- Demo modes are **destructive** against the current repository: containers
272+
are reset and `.data/db.sql` is removed before the rebuild.
273+
- Test modes wipe and recreate `/tmp/star-wars` on each run.
274+
- `destination-images` expects `drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest`
275+
to already exist locally - run `demo-image` (or `all`) first.
365276

366-
<details>
367-
<summary>Show instructions</summary>
277+
### Examples
368278

369-
1. Run a fresh install of **Vortex** into a new directory and name the project `Star Wars`:
370279
```shell
371-
mkdir /tmp/star-wars
372-
VORTEX_INSTALLER_TEMPLATE_REPO="$(pwd)" .vortex/installer/installer.php /tmp/star-wars --no-interaction
373-
cd /tmp/star-wars
374-
```
375-
2. Run fresh build of **Vortex** locally:
376-
```shell
377-
rm .data/db.sql || true
378-
VORTEX_PROVISION_TYPE=profile AHOY_CONFIRM_RESPONSE=1 ahoy build
379-
```
380-
3. Update content and config:
381-
```shell
382-
ahoy cli
383-
384-
drush eval "Drupal::entityTypeManager()->getStorage('node')->create([
385-
'type' => 'page',
386-
'title' => 'Welcome to the test site!',
387-
'body' => [
388-
'value' => '<p>This test page is sourced from the Vortex database container image to demonstrate database importing capabilities.</p>',
389-
'format' => 'basic_html',
390-
],
391-
])->save();"
280+
# Full refresh of every asset at :latest (default).
281+
php .vortex/tests/update-test-assets
392282

393-
drush config:set system.site page.front "/node/1" -y
394-
drush sql:query "SHOW TABLES LIKE 'cache_%'" | xargs -I{} drush sql:query "TRUNCATE TABLE {}" && drush sql:query "TRUNCATE TABLE watchdog"
395-
396-
exit
397-
398-
```
399-
4. Export DB:
400-
```shell
401-
ahoy export-db db.test_image.sql
283+
# Full refresh, tagging images as :rc1.
284+
php .vortex/tests/update-test-assets --tag rc1
402285

403-
# Update the collation to avoid issues with MariaDB 10.5+:
404-
sed -i '' 's/utf8mb4_0900_ai_ci/utf8mb4_general_ci/g' .data/db.test_image.sql
405-
```
406-
5. Seed the database container image:
407-
```shell
408-
curl -LO https://github.com/drevops/mariadb-drupal-data/releases/latest/download/seed.sh
409-
chmod +x seed.sh
410-
./seed.sh .data/db.test_image.sql drevops/vortex-dev-mariadb-drupal-data-test-11.x:latest
411-
```
412-
6. Update destination container images:
413-
```shell
414-
docker tag drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x:vortex-dev-database-ii
415-
docker push drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x:vortex-dev-database-ii
286+
# Refresh only the test container image at :latest.
287+
php .vortex/tests/update-test-assets test-image
416288

417-
docker tag drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x:vortex-dev-didi-database-fi
418-
docker push drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x:vortex-dev-didi-database-fi
289+
# Refresh only the test container image at :rc1.
290+
php .vortex/tests/update-test-assets test-image --tag rc1
419291
```
420-
421-
</details>

.vortex/installer/tests/Fixtures/handler_process/_baseline/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,4 @@ VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
225225
################################################################################
226226

227227
# URL of the database used for demonstration with URL database download type.
228-
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo.sql
228+
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql

.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov/.github/workflows/build-test-deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
@@ -432,6 +432,16 @@
1+
@@ -432,6 +432,17 @@
22
</details>
33
hide_and_recreate: true
44

55
+ - name: Upload coverage report to Codecov
66
+ uses: codecov/codecov-action@__HASH__ # __VERSION__
77
+ if: ${{ (matrix.instance == 0 || strategy.job-total == 1) && env.CODECOV_TOKEN != '' }}
8+
+ continue-on-error: true
89
+ with:
910
+ directory: .logs/coverage
1011
+ fail_ci_if_error: true

.vortex/installer/tests/Fixtures/handler_process/db_download_source_acquia/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
-################################################################################
3131
-
3232
-# URL of the database used for demonstration with URL database download type.
33-
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo.sql
33+
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql

.vortex/installer/tests/Fixtures/handler_process/db_download_source_container_registry/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
-################################################################################
3333
-
3434
-# URL of the database used for demonstration with URL database download type.
35-
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo.sql
35+
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql

0 commit comments

Comments
 (0)