Skip to content

Commit 997b2f4

Browse files
author
Waldek Herka
committed
ci(e2e): implement comprehensive cross-platform E2E testing infrastructure
Adds end-to-end testing for all released artifacts across multiple platforms: Platform Coverage: - Linux AMD64/ARM64 binaries - Fedora AMD64/ARM64 RPM packages - Ubuntu AMD64/ARM64 DEB packages - macOS AMD64 (macos-15-intel) and ARM64 (macos-latest) binaries - Windows AMD64 (windows-latest) and ARM64 (windows-11-arm) binaries Key Fixes: - Skip Unix permission checks on Windows (ACL-based permissions) - Fix credential helper path formatting for Windows batch wrapper - Update RPM/DEB download patterns with wildcards for release numbers Infrastructure: - E2E workflow with prerelease gate pattern - Package-specific test jobs with container isolation - nfpm.yaml for .deb/.rpm packaging - Updated Makefile with packaging targets Closes #39
1 parent 601632a commit 997b2f4

15 files changed

Lines changed: 2297 additions & 64 deletions

.github/workflows/e2e.yml

Lines changed: 490 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/release.yml

Lines changed: 79 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,102 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
release:
12+
# ─────────────────────────────────────────────────────────
13+
# Build and upload artifacts as PRERELEASE.
14+
# The release is NOT marked latest until E2E tests pass.
15+
# ─────────────────────────────────────────────────────────
16+
release-prerelease:
17+
name: Build & Prerelease
1318
runs-on: ubuntu-latest
19+
outputs:
20+
release_tag: ${{ github.ref_name }}
1421
steps:
1522
- uses: actions/checkout@v4
1623
with:
1724
fetch-depth: 0
1825

26+
- name: Verify release exists as prerelease
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: |
30+
TAG="${{ github.ref_name }}"
31+
echo "Verifying release $TAG exists as prerelease..."
32+
33+
# Check if release exists and get prerelease status
34+
RELEASE_INFO=$(gh release view "$TAG" --json isPrerelease 2>/dev/null) || {
35+
echo "Error: Release $TAG does not exist. Create it as prerelease first."
36+
exit 1
37+
}
38+
39+
IS_PRERELEASE=$(echo "$RELEASE_INFO" | jq -r '.isPrerelease')
40+
41+
if [ "$IS_PRERELEASE" != "true" ]; then
42+
echo "Error: Release $TAG exists but is NOT a prerelease. Cannot upload to immutable release."
43+
exit 1
44+
fi
45+
46+
echo "✓ Release $TAG is a prerelease - proceeding with upload"
47+
1948
- name: Set up Go
2049
uses: actions/setup-go@v5
2150
with:
2251
go-version: '1.21'
23-
cache: false # Avoid cache conflict with gh-extension-precompile
52+
cache: true
2453

25-
- name: Run tests
54+
- name: Run unit tests
2655
run: go test ./...
2756

28-
- name: Prepare Release
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
- name: Build release binaries and packages
3158
run: |
32-
# Delete existing release if it exists (allows re-running)
33-
gh release delete ${{ github.ref_name }} --yes 2>/dev/null || true
59+
# Extract version from tag (strip 'v' prefix for package version)
60+
VERSION="${GITHUB_REF_NAME#v}"
61+
export VERSION
62+
export RPM_RELEASE=1
3463
35-
# Create draft release with generated notes (precompile will add assets)
36-
gh release create ${{ github.ref_name }} \
37-
--title "🚀 ${{ github.ref_name }}" \
38-
--generate-notes \
39-
--draft=true
64+
echo "Building version: $VERSION"
65+
make release packages
4066
41-
- name: Create cross-platform builds
42-
uses: cli/gh-extension-precompile@v2
43-
with:
44-
go_version: "1.21"
67+
- name: List all built artifacts
68+
run: |
69+
echo "=== Built artifacts ==="
70+
ls -lh dist/
4571
46-
- name: Publish Release
72+
echo ""
73+
echo "=== DEB Package Info ==="
74+
for deb in dist/*.deb; do
75+
echo "--- $deb ---"
76+
dpkg-deb -I "$deb" 2>/dev/null | grep -E "(Package|Version|Architecture|Maintainer)" || echo "dpkg-deb not available"
77+
done
78+
79+
echo ""
80+
echo "=== RPM Package Info ==="
81+
for rpm in dist/*.rpm; do
82+
echo "--- $rpm ---"
83+
rpm -qip "$rpm" 2>/dev/null | grep -E "(Name|Version|Release|Architecture|Group)" || \
84+
echo "rpm command not available for detailed info"
85+
done
86+
87+
- name: Upload artifacts to prerelease
4788
env:
4889
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4990
run: |
50-
# Publish the draft release
51-
gh release edit ${{ github.ref_name }} --draft=false
91+
VERSION="${{ github.ref_name }}"
92+
93+
echo "Uploading artifacts to prerelease $VERSION..."
94+
gh release upload "$VERSION" dist/*
95+
96+
# ─────────────────────────────────────────────────────────
97+
# E2E gate: runs against the prerelease artifacts.
98+
# Promotes to latest only if all platform tests pass.
99+
# ─────────────────────────────────────────────────────────
100+
e2e-gate:
101+
name: E2E Gate
102+
needs: release-prerelease
103+
uses: ./.github/workflows/e2e.yml
104+
with:
105+
release_tag: ${{ needs.release-prerelease.outputs.release_tag }}
106+
test_org_1: "gh-app-auth-test-1"
107+
test_org_2: "gh-app-auth-test-2"
108+
secrets:
109+
E2E_APP_ID: ${{ secrets.E2E_APP_ID }}
110+
E2E_PRIVATE_KEY_B64: ${{ secrets.E2E_PRIVATE_KEY_B64 }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ vscode/
4949

5050
# Environment files
5151
.env
52+
.env.*
5253
.envrc
5354

5455
# Local configuration files (not GitHub templates)

0 commit comments

Comments
 (0)