Skip to content

Commit 89190ec

Browse files
authored
Merge pull request #2 from lilnasy/upstream
Sync upstream updates to unbreak nightly builds
2 parents 338bc54 + b38a303 commit 89190ec

File tree

12 files changed

+709
-13
lines changed

12 files changed

+709
-13
lines changed

.actrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--container-architecture linux/amd64
2+
--platform ubuntu-latest=catthehacker/ubuntu:act-latest

.github/workflows/build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
- backend: opengl
4444
artifact_name: zed-release-opengl
4545
rustflags: "--cfg gles"
46+
fail-fast: false
4647

4748
steps:
4849
- name: Enable long paths in Git
@@ -90,19 +91,22 @@ jobs:
9091
- name: Rust Cache
9192
uses: Swatinem/rust-cache@v2
9293
with:
93-
key: ${{ matrix.backend }}
94+
key: ${{ matrix.backend }}-${{ hashFiles('Cargo.lock') }}
9495
workspaces: "zed -> target"
9596

9697
- name: Setup rustflags
9798
shell: pwsh
98-
run: ./Parse-Rustflags.ps1 ${{ matrix.rustflags }}
99+
run: ./scripts/Parse-Rustflags.ps1 ${{ matrix.rustflags }}
99100

100101
- name: Build release
101102
working-directory: zed
103+
env:
104+
ZED_UPDATE_EXPLANATION: "Please use Scoop to update Zed."
102105
run: cargo build --release
103106

104107
- name: Archive build
105108
uses: actions/upload-artifact@v4
106109
with:
107110
name: ${{ matrix.artifact_name }}
108-
path: zed/target/release/zed.exe
111+
path: zed/target/release/zed.exe
112+

.github/workflows/nightly.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
# Set repository and ref based on inputs
2323
REPO="zed-industries/zed"
2424
REF="main"
25-
25+
2626
# Get latest commit info
2727
COMMIT=$(gh api repos/$REPO/commits/$REF --jq '{sha: .sha, message: .commit.message, html_url: .html_url}')
2828
SHA=$(echo $COMMIT | jq -r '.sha' | cut -c1-8)
2929
MSG=$(echo $COMMIT | jq -r '.message' | head -n 1)
3030
URL=$(echo $COMMIT | jq -r '.html_url')
31-
31+
3232
echo "Building pre-release from $REPO#$SHA: $MSG"
3333
echo "build_ref=$REF" >> $GITHUB_OUTPUT
3434
echo "build_repo=$REPO" >> $GITHUB_OUTPUT
@@ -45,6 +45,7 @@ jobs:
4545
trigger_release:
4646
name: Release
4747
needs: [find_latest_commit, trigger_build]
48+
if: always() && needs.find_latest_commit.result == 'success'
4849
uses: ./.github/workflows/release.yml
4950
with:
5051
is_prerelease: true

.github/workflows/release.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,42 @@ jobs:
2323
contents: write
2424

2525
steps:
26-
- name: Download release artifacts
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Download artifacts
2730
uses: actions/download-artifact@v4
2831
with:
2932
path: artifacts
33+
continue-on-error: false
34+
35+
- name: Verify downloaded artifacts
36+
run: |
37+
echo "Downloaded artifacts:"
38+
find artifacts -type f -name "*.exe" -exec ls -la {} \;
39+
40+
# Check if Vulkan build exists
41+
if [ ! -f "artifacts/zed-release/zed.exe" ]; then
42+
echo "❌ FAIL: Vulkan artifact not found"
43+
fi
44+
45+
if [ ! -f "artifacts/zed-release-opengl/zed.exe" ]; then
46+
echo "❌ FAIL: OpenGL artifact not found"
47+
fi
3048
3149
- name: Create release directories and zip
3250
run: |
33-
mv artifacts/zed-release/zed.exe zed.exe
34-
mv artifacts/zed-release-opengl/zed.exe zed-opengl.exe
51+
chmod +x scripts/prepare-release.sh
52+
./scripts/prepare-release.sh
3553
3654
- name: Upload release build artifacts to GitHub Release
37-
uses: softprops/action-gh-release@v2
55+
uses: softprops/action-gh-release@v2.2.2
3856
with:
3957
name: ${{ inputs.release_tag }}
4058
tag_name: ${{ inputs.release_tag }}
4159
body: ${{ inputs.release_body }}
4260
draft: false
4361
prerelease: ${{ inputs.is_prerelease }}
4462
make_latest: true
45-
files: |
46-
zed.exe
47-
zed-opengl.exe
63+
files: release/*
64+

.github/workflows/stable.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
trigger_release:
5959
name: Release
6060
needs: [check_stable_releases, trigger_build]
61+
if: always() && needs.check_stable_releases.result == 'success'
6162
uses: ./.github/workflows/release.yml
6263
with:
6364
is_prerelease: false
Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
name: Test Integration
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "scripts/**"
8+
- ".github/workflows/build.yml"
9+
- ".github/workflows/release.yml"
10+
- ".github/workflows/test-integration.yml"
11+
pull_request:
12+
branches: [main]
13+
paths:
14+
- "scripts/**"
15+
- ".github/workflows/build.yml"
16+
- ".github/workflows/release.yml"
17+
- ".github/workflows/test-integration.yml"
18+
workflow_dispatch:
19+
20+
jobs:
21+
test-build-integration:
22+
runs-on: windows-latest
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Create mock build artifacts
29+
run: |
30+
echo "Creating mock build artifacts to test integration..."
31+
32+
# Create artifacts directory structure like the real build would
33+
mkdir -p artifacts/zed-release
34+
mkdir -p artifacts/zed-release-opengl
35+
36+
# Create mock executables
37+
echo "mock vulkan zed executable content" > artifacts/zed-release/zed.exe
38+
echo "mock opengl zed executable content" > artifacts/zed-release-opengl/zed.exe
39+
40+
echo "Mock artifacts created:"
41+
Get-ChildItem -Path artifacts -Force | Format-List
42+
43+
- name: Upload mock artifacts (to test download step)
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: zed-release
47+
path: artifacts/zed-release/zed.exe
48+
49+
- name: Upload mock OpenGL artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: zed-release-opengl
53+
path: artifacts/zed-release-opengl/zed.exe
54+
55+
test-release-integration:
56+
runs-on: ubuntu-latest
57+
needs: test-build-integration
58+
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v4
62+
63+
- name: Download mock artifacts
64+
uses: actions/download-artifact@v4
65+
with:
66+
path: artifacts
67+
continue-on-error: true
68+
69+
- name: Verify downloaded artifacts
70+
run: |
71+
echo "Downloaded artifacts:"
72+
find artifacts -type f -name "*.exe" -exec ls -la {} \;
73+
74+
# Check if Vulkan build exists
75+
if [ ! -f "artifacts/zed-release/zed.exe" ]; then
76+
echo "❌ FAIL: Vulkan artifact not downloaded"
77+
exit 1
78+
fi
79+
80+
if [ ! -f "artifacts/zed-release-opengl/zed.exe" ]; then
81+
echo "❌ FAIL: OpenGL artifact not downloaded"
82+
exit 1
83+
fi
84+
85+
echo "✅ All artifacts downloaded successfully"
86+
87+
- name: Test release preparation with downloaded artifacts
88+
run: |
89+
chmod +x scripts/prepare-release.sh
90+
./scripts/prepare-release.sh
91+
92+
echo "Release files after artifact download:"
93+
ls -la release/
94+
95+
- name: Verify release files
96+
run: |
97+
# Check that all expected files exist
98+
EXPECTED_FILES=("zed.exe" "zed.zip" "zed-opengl.exe" "zed-opengl.zip" "sha256sums.txt")
99+
100+
for file in "${EXPECTED_FILES[@]}"; do
101+
if [ ! -f "release/$file" ]; then
102+
echo "❌ FAIL: Missing expected file: $file"
103+
exit 1
104+
fi
105+
echo "✅ Found: $file"
106+
done
107+
108+
# Verify checksums
109+
cd release
110+
if ! sha256sum -c sha256sums.txt; then
111+
echo "❌ FAIL: Checksum verification failed"
112+
exit 1
113+
fi
114+
115+
echo "✅ All checksums verified successfully"
116+
117+
test-partial-failure-scenarios:
118+
runs-on: ubuntu-latest
119+
120+
strategy:
121+
matrix:
122+
scenario:
123+
- name: "vulkan-only"
124+
create_vulkan: true
125+
create_opengl: false
126+
expected_files: 3
127+
- name: "opengl-only"
128+
create_vulkan: false
129+
create_opengl: true
130+
expected_files: 3
131+
- name: "both-builds"
132+
create_vulkan: true
133+
create_opengl: true
134+
expected_files: 5
135+
136+
steps:
137+
- name: Checkout repository
138+
uses: actions/checkout@v4
139+
140+
- name: Create scenario-specific artifacts
141+
run: |
142+
echo "Testing scenario: ${{ matrix.scenario.name }}"
143+
144+
if [ "${{ matrix.scenario.create_vulkan }}" = "true" ]; then
145+
echo "Creating Vulkan artifacts..."
146+
mkdir -p artifacts/zed-release
147+
echo "vulkan executable for ${{ matrix.scenario.name }}" > artifacts/zed-release/zed.exe
148+
fi
149+
150+
if [ "${{ matrix.scenario.create_opengl }}" = "true" ]; then
151+
echo "Creating OpenGL artifacts..."
152+
mkdir -p artifacts/zed-release-opengl
153+
echo "opengl executable for ${{ matrix.scenario.name }}" > artifacts/zed-release-opengl/zed.exe
154+
fi
155+
156+
echo "Created artifacts:"
157+
find artifacts -type f -name "*.exe" -exec ls -la {} \; || echo "No artifacts created"
158+
159+
- name: Test release preparation
160+
run: |
161+
chmod +x scripts/prepare-release.sh
162+
./scripts/prepare-release.sh
163+
164+
echo "Release files for scenario ${{ matrix.scenario.name }}:"
165+
ls -la release/
166+
167+
- name: Verify expected file count
168+
run: |
169+
ACTUAL_COUNT=$(ls -1 release/ | wc -l)
170+
EXPECTED_COUNT=${{ matrix.scenario.expected_files }}
171+
172+
if [ "$ACTUAL_COUNT" -ne "$EXPECTED_COUNT" ]; then
173+
echo "❌ FAIL: Expected $EXPECTED_COUNT files, got $ACTUAL_COUNT"
174+
echo "Files found:"
175+
ls -la release/
176+
exit 1
177+
fi
178+
179+
echo "✅ Correct file count for scenario ${{ matrix.scenario.name }}: $EXPECTED_COUNT files"
180+
181+
- name: Verify checksums
182+
run: |
183+
cd release
184+
if ! sha256sum -c sha256sums.txt; then
185+
echo "❌ FAIL: Checksum verification failed for scenario ${{ matrix.scenario.name }}"
186+
exit 1
187+
fi
188+
189+
echo "✅ Checksums verified for scenario ${{ matrix.scenario.name }}"
190+
191+
test-no-artifacts-failure:
192+
runs-on: ubuntu-latest
193+
194+
steps:
195+
- name: Checkout repository
196+
uses: actions/checkout@v4
197+
198+
- name: Test script fails with no artifacts
199+
run: |
200+
chmod +x scripts/prepare-release.sh
201+
202+
echo "Testing that script fails when no artifacts are present..."
203+
if ./scripts/prepare-release.sh; then
204+
echo "❌ FAIL: Script should have failed with no artifacts"
205+
exit 1
206+
else
207+
echo "✅ Script correctly failed when no artifacts present"
208+
fi
209+
210+
integration-summary:
211+
runs-on: ubuntu-latest
212+
needs:
213+
[
214+
test-build-integration,
215+
test-release-integration,
216+
test-partial-failure-scenarios,
217+
test-no-artifacts-failure,
218+
]
219+
if: always()
220+
221+
steps:
222+
- name: Report test results
223+
run: |
224+
echo "🧪 Integration Test Summary:"
225+
echo "=========================="
226+
echo ""
227+
echo "✅ Build Integration: ${{ needs.test-build-integration.result }}"
228+
echo "✅ Release Integration: ${{ needs.test-release-integration.result }}"
229+
echo "✅ Partial Failure Scenarios: ${{ needs.test-partial-failure-scenarios.result }}"
230+
echo "✅ No Artifacts Failure: ${{ needs.test-no-artifacts-failure.result }}"
231+
echo ""
232+
233+
if [ "${{ needs.test-build-integration.result }}" = "success" ] && \
234+
[ "${{ needs.test-release-integration.result }}" = "success" ] && \
235+
[ "${{ needs.test-partial-failure-scenarios.result }}" = "success" ] && \
236+
[ "${{ needs.test-no-artifacts-failure.result }}" = "success" ]; then
237+
echo "🎉 All integration tests passed!"
238+
echo "The build and release workflows are properly integrated."
239+
else
240+
echo "❌ Some integration tests failed. Check the job logs above."
241+
exit 1
242+
fi

0 commit comments

Comments
 (0)