ci: Change upstream repo and disable OpenGL builds #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Integration | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "scripts/**" | |
| - ".github/workflows/build.yml" | |
| - ".github/workflows/release.yml" | |
| - ".github/workflows/test-integration.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "scripts/**" | |
| - ".github/workflows/build.yml" | |
| - ".github/workflows/release.yml" | |
| - ".github/workflows/test-integration.yml" | |
| workflow_dispatch: | |
| jobs: | |
| test-build-integration: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Create mock build artifacts | |
| run: | | |
| echo "Creating mock build artifacts to test integration..." | |
| # Create artifacts directory structure like the real build would | |
| mkdir -p artifacts/cli-release | |
| mkdir -p artifacts/editor-dx11-release | |
| mkdir -p artifacts/editor-opengl-release | |
| # Create mock executables | |
| echo "mock cli executable content" > artifacts/cli-release/cli.exe | |
| echo "mock dx11 executable content" > artifacts/editor-dx11-release/zed.exe | |
| echo "mock opengl executable content" > artifacts/editor-opengl-release/zed.exe | |
| echo "Mock artifacts created:" | |
| Get-ChildItem -Path artifacts -Force | Format-List | |
| - name: Upload mock CLI artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli-release | |
| path: artifacts/cli-release/cli.exe | |
| - name: Upload mock DX11 artifacts (to test download step) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: editor-dx11-release | |
| path: artifacts/editor-dx11-release/zed.exe | |
| - name: Upload mock OpenGL artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: editor-opengl-release | |
| path: artifacts/editor-opengl-release/zed.exe | |
| test-release-integration: | |
| runs-on: ubuntu-latest | |
| needs: test-build-integration | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download mock artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| continue-on-error: true | |
| - name: Verify downloaded artifacts | |
| run: | | |
| echo "Downloaded artifacts:" | |
| find artifacts -type f -name "*.exe" -exec ls -la {} \; | |
| # Check if CLI build exists | |
| if [ ! -f "artifacts/cli-release/cli.exe" ]; then | |
| echo "❌ FAIL: CLI artifact not downloaded" | |
| exit 1 | |
| fi | |
| # Check if DX11 build exists | |
| if [ ! -f "artifacts/editor-dx11-release/zed.exe" ]; then | |
| echo "❌ FAIL: DX11 artifact not downloaded" | |
| exit 1 | |
| fi | |
| # Check if OpenGL build exists | |
| if [ ! -f "artifacts/editor-opengl-release/zed.exe" ]; then | |
| echo "❌ FAIL: OpenGL artifact not downloaded" | |
| exit 1 | |
| fi | |
| echo "✅ All artifacts downloaded successfully" | |
| - name: Test release preparation with downloaded artifacts | |
| run: | | |
| chmod +x scripts/prepare-release.sh | |
| ./scripts/prepare-release.sh | |
| echo "Release files after artifact download:" | |
| ls -la release/ | |
| - name: Verify release files | |
| run: | | |
| # Check that all expected files exist | |
| EXPECTED_FILES=("zed.zip" "zed-opengl.zip" "sha256sums.txt") | |
| for file in "${EXPECTED_FILES[@]}"; do | |
| if [ ! -f "release/$file" ]; then | |
| echo "❌ FAIL: Missing expected file: $file" | |
| exit 1 | |
| fi | |
| echo "✅ Found: $file" | |
| done | |
| # Verify checksums | |
| cd release | |
| if ! sha256sum -c sha256sums.txt; then | |
| echo "❌ FAIL: Checksum verification failed" | |
| exit 1 | |
| fi | |
| echo "✅ All checksums verified successfully" | |
| test-partial-failure-scenarios: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| scenario: | |
| - name: "dx11-only" | |
| create_dx11: true | |
| create_opengl: false | |
| expected_files: 2 | |
| - name: "opengl-only" | |
| create_dx11: false | |
| create_opengl: true | |
| expected_files: 2 | |
| - name: "both-builds" | |
| create_dx11: true | |
| create_opengl: true | |
| expected_files: 3 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Create scenario-specific artifacts | |
| run: | | |
| echo "Testing scenario: ${{ matrix.scenario.name }}" | |
| # Always create CLI artifacts for these scenarios | |
| mkdir -p artifacts/cli-release | |
| echo "cli executable for ${{ matrix.scenario.name }}" > artifacts/cli-release/cli.exe | |
| if [ "${{ matrix.scenario.create_dx11 }}" = "true" ]; then | |
| echo "Creating DX11 artifacts..." | |
| mkdir -p artifacts/editor-dx11-release | |
| echo "dx11 executable for ${{ matrix.scenario.name }}" > artifacts/editor-dx11-release/zed.exe | |
| fi | |
| if [ "${{ matrix.scenario.create_opengl }}" = "true" ]; then | |
| echo "Creating OpenGL artifacts..." | |
| mkdir -p artifacts/editor-opengl-release | |
| echo "opengl executable for ${{ matrix.scenario.name }}" > artifacts/editor-opengl-release/zed.exe | |
| fi | |
| echo "Created artifacts:" | |
| find artifacts -type f -name "*.exe" -exec ls -la {} \; || echo "No artifacts created" | |
| - name: Test release preparation | |
| run: | | |
| chmod +x scripts/prepare-release.sh | |
| ./scripts/prepare-release.sh | |
| echo "Release files for scenario ${{ matrix.scenario.name }}:" | |
| ls -la release/ | |
| - name: Verify expected file count | |
| run: | | |
| ACTUAL_COUNT=$(ls -1 release/ | wc -l) | |
| EXPECTED_COUNT=${{ matrix.scenario.expected_files }} | |
| if [ "$ACTUAL_COUNT" -ne "$EXPECTED_COUNT" ]; then | |
| echo "❌ FAIL: Expected $EXPECTED_COUNT files, got $ACTUAL_COUNT" | |
| echo "Files found:" | |
| ls -la release/ | |
| exit 1 | |
| fi | |
| echo "✅ Correct file count for scenario ${{ matrix.scenario.name }}: $EXPECTED_COUNT files" | |
| - name: Verify checksums | |
| run: | | |
| cd release | |
| if ! sha256sum -c sha256sums.txt; then | |
| echo "❌ FAIL: Checksum verification failed for scenario ${{ matrix.scenario.name }}" | |
| exit 1 | |
| fi | |
| echo "✅ Checksums verified for scenario ${{ matrix.scenario.name }}" | |
| test-no-artifacts-failure: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Test script fails with no artifacts | |
| run: | | |
| chmod +x scripts/prepare-release.sh | |
| echo "Testing that script fails when no artifacts are present..." | |
| if ./scripts/prepare-release.sh; then | |
| echo "❌ FAIL: Script should have failed with no artifacts" | |
| exit 1 | |
| else | |
| echo "✅ Script correctly failed when no artifacts present" | |
| fi | |
| integration-summary: | |
| runs-on: ubuntu-latest | |
| needs: | |
| [ | |
| test-build-integration, | |
| test-release-integration, | |
| test-partial-failure-scenarios, | |
| test-no-artifacts-failure, | |
| ] | |
| if: always() | |
| steps: | |
| - name: Report test results | |
| run: | | |
| echo "🧪 Integration Test Summary:" | |
| echo "==========================" | |
| echo "" | |
| echo "✅ Build Integration: ${{ needs.test-build-integration.result }}" | |
| echo "✅ Release Integration: ${{ needs.test-release-integration.result }}" | |
| echo "✅ Partial Failure Scenarios: ${{ needs.test-partial-failure-scenarios.result }}" | |
| echo "✅ No Artifacts Failure: ${{ needs.test-no-artifacts-failure.result }}" | |
| echo "" | |
| if [ "${{ needs.test-build-integration.result }}" = "success" ] && \ | |
| [ "${{ needs.test-release-integration.result }}" = "success" ] && \ | |
| [ "${{ needs.test-partial-failure-scenarios.result }}" = "success" ] && \ | |
| [ "${{ needs.test-no-artifacts-failure.result }}" = "success" ]; then | |
| echo "🎉 All integration tests passed!" | |
| echo "The build and release workflows are properly integrated." | |
| else | |
| echo "❌ Some integration tests failed. Check the job logs above." | |
| exit 1 | |
| fi |