Skip to content

Commit c395618

Browse files
committed
feat: Add detailed step descriptions to CI/CD pipeline
- Add clear step-by-step progress indicators (Step X/10) - Show what each step is doing with emoji and descriptions - Add visual separators for better readability - Include progress messages for each operation - Improve pipeline visibility and debugging
1 parent 2b1aec6 commit c395618

1 file changed

Lines changed: 79 additions & 11 deletions

File tree

.github/workflows/main.yml

Lines changed: 79 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,84 +33,130 @@ jobs:
3333

3434
- name: Install dependencies
3535
working-directory: ./scripts
36-
run: npm ci
36+
run: |
37+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
38+
echo "📦 Installing Dependencies"
39+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
40+
echo "📥 Running npm ci..."
41+
npm ci
42+
echo "✅ Dependencies installed successfully"
3743
3844
# Step 1: Run tests
3945
- name: Run Tests
4046
working-directory: ./scripts
41-
run: npm test
47+
run: |
48+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
49+
echo "🧪 Step 1/10: Running Test Suite"
50+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
51+
echo "📋 Executing all test cases..."
52+
npm test
53+
echo "✅ Tests completed successfully"
4254
4355
# Step 2: Check test coverage for new functions
4456
- name: Check Test Coverage
4557
working-directory: ./scripts
4658
run: |
59+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
60+
echo "📊 Step 2/10: Checking Test Coverage"
61+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
4762
echo "🔍 Checking if new functions have test coverage..."
4863
git fetch origin main:main || true
4964
BASE_SHA=$(git merge-base HEAD~1 HEAD 2>/dev/null || echo "HEAD~1")
50-
echo "Comparing against: $BASE_SHA"
65+
echo "📌 Comparing against commit: $BASE_SHA"
5166
npm run test:check-diff || npm run test:check
67+
echo "✅ Coverage check completed"
5268
5369
# Step 3: Get version from package.json
5470
- name: Get Version
5571
id: version
5672
run: |
73+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
74+
echo "📦 Step 3/10: Detecting Version"
75+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
76+
echo "🔍 Reading version from package.json..."
5777
VERSION=$(node -p "require('./scripts/package.json').version")
5878
echo "version=$VERSION" >> $GITHUB_OUTPUT
59-
echo "📦 Detected version: $VERSION"
79+
echo " Detected version: $VERSION"
6080
6181
# Step 4: Check if tag already exists
6282
- name: Check if Tag Exists
6383
id: check_tag
6484
run: |
85+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
86+
echo "🏷️ Step 4/10: Checking Git Tag"
87+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
6588
TAG="v${{ steps.version.outputs.version }}"
89+
echo "🔍 Checking if tag $TAG already exists..."
6690
if git rev-parse -q --verify "refs/tags/$TAG" > /dev/null 2>&1; then
6791
echo "exists=true" >> $GITHUB_OUTPUT
68-
echo "⚠️ Tag $TAG already exists, skipping tag creation"
92+
echo "⚠️ Tag $TAG already exists, skipping release creation"
6993
else
7094
echo "exists=false" >> $GITHUB_OUTPUT
71-
echo "✅ Tag $TAG does not exist, will create it"
95+
echo "✅ Tag $TAG does not exist, proceeding with release"
7296
fi
7397
7498
# Step 5: Generate minified file
7599
- name: Generate Minified File
76100
if: steps.check_tag.outputs.exists == 'false'
77101
working-directory: ./scripts
78-
run: npm run minify
102+
run: |
103+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
104+
echo "🗜️ Step 5/10: Generating Minified File"
105+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
106+
echo "📝 Minifying phantom.js..."
107+
npm run minify
108+
echo "✅ Minified file created: phantom.min.js"
79109
80110
# Step 6: Create release package
81111
- name: Create Release Package
82112
if: steps.check_tag.outputs.exists == 'false'
83113
working-directory: ./scripts
84-
run: npm run release
114+
run: |
115+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
116+
echo "📦 Step 6/10: Creating Release Package"
117+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
118+
echo "📋 Packaging files into zip archive..."
119+
npm run release
120+
echo "✅ Release package created successfully"
85121
86122
# Step 7: Create Git tag
87123
- name: Create Git Tag
88124
if: steps.check_tag.outputs.exists == 'false'
89125
run: |
126+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
127+
echo "🏷️ Step 7/10: Creating Git Tag"
128+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
90129
TAG="v${{ steps.version.outputs.version }}"
130+
echo "📝 Creating annotated tag: $TAG"
91131
git config user.name "github-actions[bot]"
92132
git config user.email "github-actions[bot]@users.noreply.github.com"
93133
git tag -a "$TAG" -m "Release $TAG: Auto-generated from main branch merge"
134+
echo "📤 Pushing tag to remote..."
94135
git push origin "$TAG"
95-
echo "✅ Created and pushed tag: $TAG"
136+
echo "✅ Tag $TAG created and pushed successfully"
96137
97138
# Step 8: Generate release notes automatically
98139
- name: Generate Release Notes
99140
if: steps.check_tag.outputs.exists == 'false'
100141
id: release_notes
101142
working-directory: ./scripts
102143
run: |
144+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
145+
echo "📝 Step 8/10: Generating Release Notes"
146+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
103147
VERSION="${{ steps.version.outputs.version }}"
104-
echo "📝 Generating release notes for v${VERSION}..."
148+
echo "📋 Analyzing commits since last release..."
149+
echo "🔍 Extracting features, fixes, and changes..."
105150
node generate-release-notes.js "${VERSION}" > /tmp/release_notes.txt || {
106-
echo "⚠️ Failed to generate release notes, using default"
151+
echo "⚠️ Failed to generate release notes, using default template"
107152
printf "## Release v%s\n\nThis release includes bug fixes and improvements.\n\n### Changes\n- See commit history for details\n" "${VERSION}" > /tmp/release_notes.txt
108153
}
109154
{
110155
echo "notes<<EOF"
111156
cat /tmp/release_notes.txt
112157
echo "EOF"
113158
} >> $GITHUB_OUTPUT
159+
echo "✅ Release notes generated successfully"
114160
115161
# Step 9: Create GitHub Release
116162
- name: Create GitHub Release
@@ -129,6 +175,28 @@ jobs:
129175
# Step 10: Summary
130176
- name: Pipeline Summary
131177
run: |
178+
echo ""
179+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
180+
echo "✅ Step 10/10: Pipeline Complete"
181+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
182+
echo ""
183+
if [ "${{ steps.check_tag.outputs.exists }}" == "false" ]; then
184+
echo "🎉 Release v${{ steps.version.outputs.version }} created successfully!"
185+
echo ""
186+
echo "📦 Release Package:"
187+
echo " release/phantom-${{ steps.version.outputs.version }}.zip"
188+
echo ""
189+
echo "🏷️ Git Tag:"
190+
echo " v${{ steps.version.outputs.version }}"
191+
echo ""
192+
echo "🌐 GitHub Release:"
193+
echo " https://github.com/${{ github.repository }}/releases/tag/v${{ steps.version.outputs.version }}"
194+
else
195+
echo "ℹ️ Tag v${{ steps.version.outputs.version }} already exists"
196+
echo " Skipping release creation"
197+
fi
198+
echo ""
199+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
132200
if [ "${{ steps.check_tag.outputs.exists }}" == "true" ]; then
133201
echo "ℹ️ Tag v${{ steps.version.outputs.version }} already exists"
134202
echo " Skipping release creation"

0 commit comments

Comments
 (0)