Skip to content

Commit 12ac228

Browse files
committed
Enhance Linux dependency installation with improved logging, Microsoft repository check, and error handling
1 parent ff0ecaf commit 12ac228

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,19 @@ jobs:
6666
- name: Install Linux Dependencies
6767
shell: bash
6868
run: |
69-
echo "Installing Linux dependencies for PowerShell DSC..."
69+
echo -e "\033[32mInstalling Linux dependencies for PowerShell DSC...\033[0m"
7070
7171
# Update package list
72-
sudo apt-get update -qq
72+
echo "::group::Update package list"
73+
echo -e "\033[36mUpdating package list...\033[0m"
74+
sudo apt-get update
75+
echo -e "\033[32m✓ Package list updated successfully\033[0m"
76+
echo "::endgroup::"
7377
7478
# Check if Microsoft repository is already added, if not add it
7579
if ! grep -q "packages.microsoft.com" /etc/apt/sources.list /etc/apt/sources.list.d/* 2>/dev/null; then
76-
echo "Adding Microsoft repository..."
80+
echo "::group::Add Microsoft repository"
81+
echo -e "\033[33mAdding Microsoft repository...\033[0m"
7782
# Add Microsoft's GPG key and repository (keyring)
7883
sudo install -m 0755 -d /etc/apt/keyrings
7984
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg >/dev/null
@@ -82,48 +87,71 @@ jobs:
8287
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/microsoft-ubuntu-${DISTRO_CODENAME}-prod ${DISTRO_CODENAME} main" | sudo tee "/etc/apt/sources.list.d/microsoft-${DISTRO_CODENAME}-prod.list" >/dev/null
8388
8489
# Update package list again after adding the new repo
85-
sudo apt-get update -qq
90+
echo -e "\033[36mUpdating package list after adding Microsoft repository...\033[0m"
91+
sudo apt-get update
92+
echo -e "\033[32m✓ Microsoft repository added successfully\033[0m"
93+
echo "::endgroup::"
8694
else
87-
echo "Microsoft repository already configured, skipping..."
95+
echo -e "\033[33mMicrosoft repository already configured, skipping...\033[0m"
96+
echo "::notice::Microsoft repository was already configured"
8897
fi
8998
9099
# Install OMI (Open Management Infrastructure) which provides libmi
100+
echo "::group::Install OMI and dependencies"
91101
if apt-cache policy omi 2>/dev/null | grep -q 'Candidate:'; then
92-
if ! sudo apt-get install -y -qq omi; then
93-
echo "WARNING: 'omi' package failed to install; continuing."
102+
echo -e "\033[36mInstalling OMI package...\033[0m"
103+
if ! sudo apt-get install -y omi; then
104+
echo -e "\033[31m⚠ OMI package failed to install; continuing...\033[0m"
105+
echo "::warning::OMI package failed to install; continuing without OMI"
106+
else
107+
echo -e "\033[32m✓ OMI package installed successfully\033[0m"
94108
fi
95109
else
96-
echo "Package 'omi' not found in repositories; skipping OMI install."
110+
echo -e "\033[33mPackage 'omi' not found in repositories; skipping OMI install.\033[0m"
111+
echo "::notice::OMI package not found in repositories, skipping installation"
97112
fi
113+
echo "::endgroup::"
98114
99-
# Also install other dependencies that might be needed
100-
sudo apt-get install -y -qq libc6-dev libssl-dev
115+
echo "::group::Installing additional development dependencies..."
116+
echo -e "\033[36mInstalling development dependencies (libc6-dev, libssl-dev)...\033[0m"
117+
sudo apt-get install -y libc6-dev libssl-dev
118+
echo -e "\033[32m✓ Development dependencies installed successfully\033[0m"
119+
echo "::endgroup::"
101120
102121
# Set LD_LIBRARY_PATH permanently for the runner session
122+
echo -e "\033[36mSetting LD_LIBRARY_PATH environment variable...\033[0m"
103123
echo "LD_LIBRARY_PATH=/opt/omi/lib:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
124+
echo -e "\033[32m✓ Environment variable set successfully\033[0m"
104125
105-
echo "Linux dependencies installed successfully."
126+
echo -e "\033[32m🎉 Linux dependencies installed successfully!\033[0m"
106127
107128
- name: Configure PowerShell Environment
108129
shell: pwsh
109130
run: |
110131
Write-Host "Configure PowerShell environment..." -ForegroundColor Green
111132
112133
# Install dependent PowerShell modules
134+
Write-Host "Installing SqlServer module..." -ForegroundColor Cyan
113135
Install-PSResource -Name 'SqlServer' -Version '21.1.18256' -Scope 'CurrentUser' -Repository 'PSGallery' -TrustRepository
136+
Write-Host "✓ SqlServer module installed successfully" -ForegroundColor Green
137+
138+
Write-Host "Installing PSDSC module..." -ForegroundColor Cyan
114139
Install-PSResource -Name 'PSDSC' -Scope 'CurrentUser' -Repository 'PSGallery' -TrustRepository
140+
Write-Host "✓ PSDSC module installed successfully" -ForegroundColor Green
115141
116-
Write-Host "PowerShell environment configuration complete." -ForegroundColor Green
142+
Write-Host "🎉 PowerShell environment configuration complete!" -ForegroundColor Green
117143
118144
- name: Install DSCv3
119145
shell: pwsh
120146
run: |
121147
Write-Host "Install DSCv3 in environment..." -ForegroundColor Green
122148
123149
# Install dependent PowerShell modules
150+
Write-Host "Installing DSCv3 executable..." -ForegroundColor Cyan
124151
Install-DscExe -IncludePrerelease -Force
152+
Write-Host "✓ DSCv3 installed successfully" -ForegroundColor Green
125153
126-
Write-Host "DSCv3 install complete." -ForegroundColor Green
154+
Write-Host "🎉 DSCv3 install complete!" -ForegroundColor Green
127155
128156
- name: Verify DSCv3
129157
shell: pwsh

0 commit comments

Comments
 (0)