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.
31 lines
933 B
YAML
31 lines
933 B
YAML
name: checks.external-urls
|
|
|
|
on:
|
|
push:
|
|
schedule:
|
|
- cron: '0 0 * * 0' # at 00:00 on every Sunday
|
|
|
|
jobs:
|
|
run-check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Setup node
|
|
uses: ./.github/actions/setup-node
|
|
-
|
|
name: Install dependencies
|
|
uses: ./.github/actions/npm-install-dependencies
|
|
-
|
|
name: Enforce IPv4 Connectivity # Used due to GitHub runners' lack of IPv6 support, preventing request timeouts.
|
|
uses: ./.github/actions/force-ipv4
|
|
-
|
|
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.
|