-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 2.28 KB
/
Copy pathcheck.yml
File metadata and controls
63 lines (54 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Test fetchValidManifest (transient failure)
on:
workflow_dispatch:
jobs:
retry-recovers:
name: API blackout, expect retry to recover
runs-on: ubuntu-latest
env:
ACTIONS_STEP_DEBUG: true
steps:
- uses: actions/checkout@v6
# Block api.github.com by pointing it to a loopback that drops :443.
# Attempt #1 fails immediately (connection refused). fetchValidManifest
# sleeps 1s, attempt #2 fails, it sleeps 2s. We restore DNS at t=2.5s
# so attempt #3 succeeds -- exercising the retry-with-backoff branch
# WITHOUT falling through to the raw-URL source.
- name: Start blackout (api.github.com -> 127.0.0.1)
run: |
echo "127.0.0.1 api.github.com" | sudo tee -a /etc/hosts
( sleep 2.5 && sudo sed -i '/127\.0\.0\.1 api\.github\.com/d' /etc/hosts && echo "RESTORED at $(date +%T.%N)" ) &
disown
echo "BLOCKED at $(date +%T.%N)"
- name: Setup Python (force manifest fetch)
id: setup
uses: actions/setup-python@v6
with:
python-version: '3.11' # range -> resolves to newest 3.11.x in manifest
check-latest: true # forces getManifest() even if 3.11 is pre-installed
- name: Verify install succeeded
run: |
echo "Resolved: ${{ steps.setup.outputs.python-version }}"
python -c "import sys; print(sys.version)"
retry-exhausted-falls-back-to-url:
name: API permanently down, expect raw-URL fallback
runs-on: ubuntu-latest
env:
ACTIONS_STEP_DEBUG: true
steps:
- uses: actions/checkout@v6
# Keep api.github.com unreachable for the whole run. fetchValidManifest
# burns all 3 attempts on the API source, getManifest() catches the error
# and falls back to raw.githubusercontent.com (still reachable).
- name: Permanent API blackout
run: echo "127.0.0.1 api.github.com" | sudo tee -a /etc/hosts
- name: Setup Python (must use URL fallback)
id: setup
uses: actions/setup-python@v6
with:
python-version: '3.13'
check-latest: true
- name: Verify install succeeded via fallback
run: |
echo "Resolved: ${{ steps.setup.outputs.python-version }}"
python -c "import sys; print(sys.version)"