check-source-domain.yml 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: Check Domain Availability
  2. on:
  3. # manual trigger only
  4. workflow_dispatch:
  5. jobs:
  6. check:
  7. name: Check (shard ${{ matrix.shard }}/6)
  8. runs-on: ubuntu-slim
  9. strategy:
  10. # Keep every shard running even if one hits a fatal error, so we still
  11. # collect dead domains from the rest.
  12. fail-fast: false
  13. matrix:
  14. # 6 shards -> 6 runners, each lands on a different Azure region / egress
  15. # IP, spreading DoH load and reducing per-server rate limiting.
  16. shard: [0, 1, 2, 3, 4, 5]
  17. steps:
  18. # - name: Tune GitHub-hosted runner network
  19. # # https://github.com/actions/runner-images/issues/1187
  20. # uses: smorimoto/tune-github-hosted-runner-network@v1
  21. - uses: actions/checkout@v6
  22. with:
  23. persist-credentials: false
  24. - uses: pnpm/action-setup@v5
  25. with:
  26. run_install: false
  27. - uses: actions/setup-node@v6
  28. with:
  29. node-version-file: ".node-version"
  30. cache: "pnpm"
  31. - name: Get current date
  32. id: date
  33. run: |
  34. echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
  35. echo "year=$(date +'%Y')" >> $GITHUB_OUTPUT
  36. echo "month=$(date +'%m')" >> $GITHUB_OUTPUT
  37. echo "day=$(date +'%d')" >> $GITHUB_OUTPUT
  38. echo "hour=$(date +'%H')" >> $GITHUB_OUTPUT
  39. echo "minute=$(date +'%M')" >> $GITHUB_OUTPUT
  40. echo "second=$(date +'%S')" >> $GITHUB_OUTPUT
  41. - name: Restore cache.db
  42. uses: actions/cache/restore@v5
  43. id: cache-db-restore
  44. with:
  45. path: |
  46. .cache
  47. # Cache is keyed per shard: each shard checks a disjoint subset of
  48. # domains, so their DoH/whois caches don't overlap.
  49. key: ${{ runner.os }}-shard${{ matrix.shard }}-v3-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }} ${{ steps.date.outputs.hour }}:${{ steps.date.outputs.minute }}:${{ steps.date.outputs.second }}
  50. # If source files changed but packages didn't, rebuild from a prior cache.
  51. restore-keys: |
  52. ${{ runner.os }}-shard${{ matrix.shard }}-v3-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }} ${{ steps.date.outputs.hour }}:${{ steps.date.outputs.minute }}:
  53. ${{ runner.os }}-shard${{ matrix.shard }}-v3-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }} ${{ steps.date.outputs.hour }}:
  54. ${{ runner.os }}-shard${{ matrix.shard }}-v3-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }}
  55. ${{ runner.os }}-shard${{ matrix.shard }}-v3-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-
  56. ${{ runner.os }}-shard${{ matrix.shard }}-v3-${{ steps.date.outputs.year }}-
  57. ${{ runner.os }}-shard${{ matrix.shard }}-v3-
  58. - run: pnpm config set --location=global minimumReleaseAge 0
  59. - run: pnpm install
  60. - run: pnpm run node Build/validate-domain-alive.ts
  61. env:
  62. DEBUG: domain-alive:dead-domain,domain-alive:error:*
  63. SHARD_INDEX: ${{ matrix.shard }}
  64. SHARD_TOTAL: 6
  65. - name: Cache cache.db
  66. if: always()
  67. uses: actions/cache/save@v5
  68. with:
  69. path: |
  70. .cache
  71. key: ${{ runner.os }}-shard${{ matrix.shard }}-v3-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }} ${{ steps.date.outputs.hour }}:${{ steps.date.outputs.minute }}:${{ steps.date.outputs.second }}