|
| 1 | +name: Nightly Soak |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 2 * * *' # Every night at 2am UTC |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + duration_minutes: |
| 9 | + description: 'Soak duration in minutes (default: 240 = 4h)' |
| 10 | + type: number |
| 11 | + default: 240 |
| 12 | + platforms: |
| 13 | + description: 'Platforms to test' |
| 14 | + type: choice |
| 15 | + options: ['all', 'linux-only', 'macos-only'] |
| 16 | + default: 'all' |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +jobs: |
| 22 | + soak-nightly: |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + timeout-minutes: 330 # 5.5h safety cap (4h soak + build + analysis) |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + include: |
| 29 | + - os: ubuntu-latest |
| 30 | + goos: linux |
| 31 | + goarch: amd64 |
| 32 | + cc: gcc |
| 33 | + cxx: g++ |
| 34 | + filter: all linux-only |
| 35 | + - os: ubuntu-24.04-arm |
| 36 | + goos: linux |
| 37 | + goarch: arm64 |
| 38 | + cc: gcc |
| 39 | + cxx: g++ |
| 40 | + filter: all linux-only |
| 41 | + - os: macos-14 |
| 42 | + goos: darwin |
| 43 | + goarch: arm64 |
| 44 | + cc: cc |
| 45 | + cxx: c++ |
| 46 | + filter: all macos-only |
| 47 | + steps: |
| 48 | + - name: Check platform filter |
| 49 | + if: ${{ !contains(matrix.filter, inputs.platforms || 'all') }} |
| 50 | + run: | |
| 51 | + echo "Skipping ${{ matrix.goos }}-${{ matrix.goarch }} (filter: ${{ inputs.platforms }})" |
| 52 | + exit 0 |
| 53 | +
|
| 54 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
| 55 | + |
| 56 | + - name: Install deps (Linux) |
| 57 | + if: startsWith(matrix.os, 'ubuntu') |
| 58 | + run: sudo apt-get update && sudo apt-get install -y zlib1g-dev python3 git |
| 59 | + |
| 60 | + - name: Build (release mode) |
| 61 | + run: scripts/build.sh CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} |
| 62 | + |
| 63 | + - name: Nightly soak (${{ inputs.duration_minutes || 240 }} min) |
| 64 | + run: scripts/soak-test.sh build/c/codebase-memory-mcp ${{ inputs.duration_minutes || 240 }} |
| 65 | + |
| 66 | + - name: Upload soak metrics |
| 67 | + if: always() |
| 68 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 69 | + with: |
| 70 | + name: nightly-soak-${{ matrix.goos }}-${{ matrix.goarch }} |
| 71 | + path: soak-results/ |
| 72 | + retention-days: 30 |
| 73 | + |
| 74 | + soak-nightly-asan: |
| 75 | + runs-on: ${{ matrix.os }} |
| 76 | + timeout-minutes: 120 # ASan runs shorter (60 min) due to 2-3x overhead |
| 77 | + strategy: |
| 78 | + fail-fast: false |
| 79 | + matrix: |
| 80 | + include: |
| 81 | + - os: ubuntu-latest |
| 82 | + goos: linux |
| 83 | + goarch: amd64 |
| 84 | + cc: gcc |
| 85 | + cxx: g++ |
| 86 | + filter: all linux-only |
| 87 | + - os: ubuntu-24.04-arm |
| 88 | + goos: linux |
| 89 | + goarch: arm64 |
| 90 | + cc: gcc |
| 91 | + cxx: g++ |
| 92 | + filter: all linux-only |
| 93 | + steps: |
| 94 | + - name: Check platform filter |
| 95 | + if: ${{ !contains(matrix.filter, inputs.platforms || 'all') }} |
| 96 | + run: exit 0 |
| 97 | + |
| 98 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
| 99 | + |
| 100 | + - name: Install deps |
| 101 | + run: sudo apt-get update && sudo apt-get install -y zlib1g-dev python3 git |
| 102 | + |
| 103 | + - name: Build (ASan + LeakSanitizer) |
| 104 | + run: | |
| 105 | + SANITIZE="-fsanitize=address,undefined -fno-omit-frame-pointer" |
| 106 | + scripts/build.sh CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} EXTRA_CFLAGS="$SANITIZE" EXTRA_LDFLAGS="$SANITIZE" |
| 107 | +
|
| 108 | + - name: ASan soak (60 min) |
| 109 | + env: |
| 110 | + ASAN_OPTIONS: "detect_leaks=1:halt_on_error=0:log_path=soak-results/asan" |
| 111 | + run: scripts/soak-test.sh build/c/codebase-memory-mcp 60 |
| 112 | + |
| 113 | + - name: Upload ASan soak metrics |
| 114 | + if: always() |
| 115 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 116 | + with: |
| 117 | + name: nightly-asan-${{ matrix.goos }}-${{ matrix.goarch }} |
| 118 | + path: soak-results/ |
| 119 | + retention-days: 30 |
0 commit comments