1
+ name : CI Documentation Scripts
2
+
3
+ # This workflow tests the CI documentation setup scripts to ensure they work correctly.
4
+ # It runs nightly and on-demand to avoid slowing down regular development workflow.
5
+ on :
6
+ pull_request :
7
+ types : [labeled]
8
+ # Only runs when 'test-doc-scripts' or 'test-ci' label is added to a PR
9
+ schedule :
10
+ # Run nightly to catch environment drift and ensure scripts stay functional
11
+ - cron : ' 0 3 * * *'
12
+ workflow_dispatch :
13
+ # Allow manual triggering for testing
14
+
15
+ jobs :
16
+ test-act-installation :
17
+ name : Test Act Installation (${{ matrix.os }})
18
+ runs-on : ${{ matrix.os }}
19
+ # Only run if the event is scheduled, manual, or PR has test-doc-scripts or test-ci label
20
+ if : |
21
+ github.event_name == 'schedule' ||
22
+ github.event_name == 'workflow_dispatch' ||
23
+ contains(github.event.pull_request.labels.*.name, 'test-doc-scripts') ||
24
+ contains(github.event.pull_request.labels.*.name, 'test-ci')
25
+ strategy :
26
+ matrix :
27
+ os : [ubuntu-22.04, ubuntu-24.04, macos-latest]
28
+
29
+ steps :
30
+ - name : Checkout repository
31
+ uses : actions/checkout@v5
32
+
33
+ - name : Test GitHub CLI installation (Ubuntu)
34
+ if : startsWith(matrix.os, 'ubuntu')
35
+ run : |
36
+ # Execute the install-gh-cli-ubuntu.sh script as a user would
37
+ bash ./website/docs/developers/scripts/ci/install-gh-cli-ubuntu.sh
38
+
39
+ - name : Test GitHub CLI installation (macOS)
40
+ if : startsWith(matrix.os, 'macos')
41
+ run : |
42
+ # Execute the install-gh-cli-macos.sh script as a user would
43
+ bash ./website/docs/developers/scripts/ci/install-gh-cli-macos.sh
44
+
45
+ - name : Test act extension installation
46
+ env :
47
+ GH_TOKEN : ${{ github.token }}
48
+ run : |
49
+ # Execute the install-act.sh script as a user would
50
+ bash ./website/docs/developers/scripts/ci/install-act.sh
51
+
52
+ - name : Test act functionality
53
+ run : |
54
+ # Execute the test-act-functionality.sh script as a user would
55
+ bash ./website/docs/developers/scripts/ci/test-act-functionality.sh
56
+
57
+ verify-ci-script-consistency :
58
+ name : Verify CI Script Consistency
59
+ runs-on : ubuntu-latest
60
+ # Always run this check on PRs that modify CI scripts
61
+ if : |
62
+ github.event_name == 'pull_request' &&
63
+ (contains(github.event.pull_request.labels.*.name, 'test-doc-scripts') ||
64
+ contains(github.event.pull_request.labels.*.name, 'test-ci'))
65
+
66
+ steps :
67
+ - name : Checkout repository
68
+ uses : actions/checkout@v5
69
+
70
+ - name : Check CI script files exist
71
+ run : |
72
+ # Verify all referenced CI scripts exist
73
+ scripts=(
74
+ "website/docs/developers/scripts/ci/install-gh-cli-ubuntu.sh"
75
+ "website/docs/developers/scripts/ci/install-gh-cli-macos.sh"
76
+ "website/docs/developers/scripts/ci/install-act.sh"
77
+ "website/docs/developers/scripts/ci/test-act-functionality.sh"
78
+ )
79
+
80
+ missing=0
81
+ for script in "${scripts[@]}"; do
82
+ if [ ! -f "$script" ]; then
83
+ echo "❌ Missing script: $script"
84
+ missing=$((missing + 1))
85
+ else
86
+ echo "✅ Found: $script"
87
+ fi
88
+ done
89
+
90
+ if [ $missing -gt 0 ]; then
91
+ echo "ERROR: $missing script(s) missing"
92
+ exit 1
93
+ fi
94
+
95
+ - name : Verify CI scripts are referenced in documentation
96
+ run : |
97
+ # Check that all CI scripts are imported in the CI local MDX file
98
+ mdx_file="website/docs/developers/testing/ci-local.mdx"
99
+
100
+ if [ ! -f "$mdx_file" ]; then
101
+ echo "❌ CI local documentation file not found: $mdx_file"
102
+ exit 1
103
+ fi
104
+
105
+ # Check for script imports
106
+ scripts=(
107
+ "install-gh-cli-ubuntu.sh"
108
+ "install-gh-cli-macos.sh"
109
+ "install-act.sh"
110
+ )
111
+
112
+ missing=0
113
+ for script in "${scripts[@]}"; do
114
+ if ! grep -q "$script" "$mdx_file"; then
115
+ echo "❌ Script not referenced in docs: $script"
116
+ missing=$((missing + 1))
117
+ else
118
+ echo "✅ Script referenced: $script"
119
+ fi
120
+ done
121
+
122
+ if [ $missing -gt 0 ]; then
123
+ echo "ERROR: $missing script(s) not referenced in documentation"
124
+ exit 1
125
+ fi
0 commit comments