ci/cd: trigger URL checks more, and limit amount

Key changes:

- Run URL checks more frequently on every change.
- Introduce environment variable to randomly select and limit URLs
  tested, this way the tests will provide quicker feedback on code
  changes.

Other supporting changes:

- Log more information about test before running the test to enable
  easier troubleshooting.
- Move shuffle function for arrays for reusability and missing tests.
This commit is contained in:
undergroundwires
2024-03-31 13:39:01 +02:00
parent 59decd17e2
commit 4fb6302c67
6 changed files with 221 additions and 40 deletions

View File

@@ -1,6 +1,7 @@
name: checks.external-urls
on:
push:
schedule:
- cron: '0 0 * * 0' # at 00:00 on every Sunday
@@ -23,3 +24,7 @@ jobs:
-
name: Test
run: npm run check:external-urls
env:
RANDOMIZED_URL_CHECK_LIMIT: "${{ github.event_name == 'push' && '100' || '3000' }}"
# - Scheduled checks has high limit for thorough testing.
# - For push events, triggered by code changes, the amount of URLs are limited to provide quick feedback.