diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml index cd357ee..4ba03a6 100644 --- a/.github/workflows/unstable.yml +++ b/.github/workflows/unstable.yml @@ -1,13 +1,11 @@ name: Unstable on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' pull_request: + branches: [ unstable ] paths: - - 'snap/**' - - '.github/workflows/**' + - '.github/workflows/unstable.yml' + workflow_call: jobs: build: @@ -23,31 +21,37 @@ jobs: runs-on: ${{ matrix.runner }} steps: - - uses: actions/checkout@v4 - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request && github.sha || 'unstable' }} + + - name: Checkout Redis repository (unstable branch) + uses: actions/checkout@v4 with: repository: redis/redis path: redis - ref: '8.0.2' + ref: 'unstable' + - name: Configure Redis modules to use master + run: | + echo "Updating module versions to use master branch" + for module in redisbloom redisearch redistimeseries redisjson; do + if [ -f "redis/modules/${module}/Makefile" ]; then + echo "Updating ${module} to use master branch" + sed -i 's/MODULE_VERSION = .*/MODULE_VERSION = master/' "redis/modules/${module}/Makefile" + echo "Verifying ${module} version: $(grep "MODULE_VERSION" "redis/modules/${module}/Makefile")" + fi + done - name: Setup Snapcraft run: | sudo snap install snapcraft --classic - - uses: canonical/setup-lxd@v0.1.2 - name: Build Snap env: SNAPCRAFT_BUILD_INFO: 1 run: | sudo snapcraft - - - name: Upload - if: github.ref == 'refs/heads/master' - run: | - for f in *.snap; do snapcraft upload --release=edge $f; done - env: - SNAPCRAFT_STORE_CREDENTIALS: ${{secrets.SNAP_TOKEN}} - - name: Upload to artifacts uses: actions/upload-artifact@v4 with: @@ -56,6 +60,59 @@ jobs: *.snap retention-days: 1 + - name: Capture build logs on failure + if: failure() + run: | + mkdir -p /tmp/build-logs + + echo "Build failed for snap on ${{ matrix.architecture }}" + echo "Capturing detailed logs for troubleshooting..." + + # Get system info + uname -a > /tmp/build-logs/system-info.log 2>&1 + snap --version > /tmp/build-logs/snap-info.log 2>&1 + snapcraft --version >> /tmp/build-logs/snap-info.log 2>&1 + + # Get LXD container info + lxc list > /tmp/build-logs/lxc-list.log 2>&1 || echo "Failed to list LXC containers" + lxc info > /tmp/build-logs/lxc-info.log 2>&1 || echo "Failed to get LXC info" + + # Get snap environment info + snap list > /tmp/build-logs/snap-list.log 2>&1 + + # Get Redis source info + if [ -d "redis" ]; then + (cd redis && git log -n 3) > /tmp/build-logs/redis-git-info.log 2>&1 + find redis/modules -name "Makefile" -exec grep "MODULE_VERSION" {} \; > /tmp/build-logs/module-versions.log 2>&1 + fi + + # Get snap parts info if they exist + if [ -d "parts" ]; then + find parts -name "*.log" -exec cp {} /tmp/build-logs/ \; || echo "No part logs found" + find parts -type f -name "*.log" | sort > /tmp/build-logs/parts-logs-list.txt 2>&1 + fi + + # Create a summary file + { + echo "Build failure summary for snap on ${{ matrix.architecture }}" + echo "Date: $(date)" + echo "GitHub SHA: ${{ github.sha }}" + echo "Architecture: ${{ matrix.architecture }}" + echo "Runner: ${{ matrix.runner }}" + echo "Distribution: snap" + } > /tmp/build-logs/failure-summary.txt + + echo "Log capture complete" + + - name: Upload build failure logs + if: failure() + uses: actions/upload-artifact@v4 + with: + name: build-failure-${{ matrix.architecture }}-snap + path: /tmp/build-logs/ + retention-days: 30 + if-no-files-found: warn + test: needs: build strategy: @@ -69,7 +126,7 @@ jobs: - architecture: amd64 os: ubuntu-24.04 runner: ubuntu-24.04 - + # ARM64 runners - architecture: arm64 os: ubuntu-22.04 @@ -213,4 +270,4 @@ jobs: - name: Cleanup if: always() run: | - sudo snap remove redis || true + sudo snap remove redis || true \ No newline at end of file diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a86d72c..dabc913 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -76,7 +76,7 @@ parts: source: conf-dist organize: redis.conf: conf-dist/redis.conf - + cmake-install: plugin: nil override-build: | @@ -84,7 +84,7 @@ parts: snapcraftctl build build-packages: - snapd - + redis: after: [cmake-install] plugin: make @@ -117,6 +117,8 @@ parts: - unzip - rsync - clang + - llvm + - libclang-dev - automake - autoconf - libtool