|
| 1 | +name: Swift Nightly |
| 2 | + |
| 3 | +# Long fuzz runs of the Swift client, on seeds the PR checks don't reach. Each |
| 4 | +# run takes new seeds from its run number, and a failure names the seed to |
| 5 | +# replay: JS's answers to new random queries, pushes and client scenarios, |
| 6 | +# compared with Swift's; and the ZeroVirtual fuzz. |
| 7 | + |
| 8 | +on: |
| 9 | + schedule: |
| 10 | + # 3 AM US Eastern. |
| 11 | + - cron: '0 7 * * *' |
| 12 | + workflow_dispatch: |
| 13 | + inputs: |
| 14 | + seeds: |
| 15 | + description: How many seeds to run |
| 16 | + default: '10000' |
| 17 | + first-seed: |
| 18 | + description: The seed (the run number when empty); ZeroVirtual's first seed |
| 19 | + default: '' |
| 20 | + |
| 21 | +permissions: |
| 22 | + contents: read |
| 23 | + |
| 24 | +jobs: |
| 25 | + # JS's answers on new seeds, 5 to 10 times the PR checks' cases. The seeds |
| 26 | + # are printed, so a mismatch replays with the same environment variables. |
| 27 | + differential-vectors: |
| 28 | + name: Differential vectors (JS) |
| 29 | + runs-on: ubuntu-latest |
| 30 | + timeout-minutes: 30 |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 33 | + with: |
| 34 | + persist-credentials: false |
| 35 | + - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 |
| 36 | + with: |
| 37 | + version: 11.11.0 |
| 38 | + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 |
| 39 | + with: |
| 40 | + node-version-file: .nvmrc |
| 41 | + package-manager-cache: false |
| 42 | + - run: pnpm install --frozen-lockfile |
| 43 | + - name: Generate |
| 44 | + working-directory: packages/zero-conformance |
| 45 | + env: |
| 46 | + SEED: ${{ inputs.first-seed || format('{0}', github.run_number) }} |
| 47 | + run: | |
| 48 | + base=$((1000000 + SEED)) |
| 49 | + export IVM_FUZZ_SEED=$base IVM_FUZZ_CASES=6000 |
| 50 | + export SWEEP_IVM_SEED=$base SWEEP_IVM_CASES=15000 |
| 51 | + export HARDEN_IVM_SEED=$((base * 10)) HARDEN_IVM_SEEDS=5 |
| 52 | + export AGG_FUZZ_SEED=$base AGG_FUZZ_CASES=750 |
| 53 | + env | grep -E '_(SEED|SEEDS|CASES)=' | sort |
| 54 | + pnpm exec vitest run src/ivm/ivm.test.ts src/ivm/ivm-features.test.ts \ |
| 55 | + src/ivm/sweep-ivm.test.ts src/ivm/harden-ivm.test.ts src/client/bughunt.test.ts |
| 56 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 57 | + with: |
| 58 | + name: differential-vectors |
| 59 | + path: packages/zero-conformance/generated/ |
| 60 | + if-no-files-found: error |
| 61 | + retention-days: 7 |
| 62 | + |
| 63 | + differential-swift: |
| 64 | + name: Differential vectors (Swift) |
| 65 | + needs: differential-vectors |
| 66 | + runs-on: ubuntu-latest |
| 67 | + container: swift:6.2.4-bookworm |
| 68 | + timeout-minutes: 60 |
| 69 | + defaults: |
| 70 | + run: |
| 71 | + working-directory: swift |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 74 | + with: |
| 75 | + persist-credentials: false |
| 76 | + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 77 | + with: |
| 78 | + name: differential-vectors |
| 79 | + path: packages/zero-conformance/generated/ |
| 80 | + - name: Install system libraries |
| 81 | + run: apt-get update && apt-get install -y --no-install-recommends libsqlite3-dev |
| 82 | + - name: Build |
| 83 | + run: swift build --build-tests |
| 84 | + - name: Compare with JS |
| 85 | + run: swift test --skip-build --filter 'HardenIVMTests|SweepIVMTests|IVMConformanceTests|BugHuntTests' |
| 86 | + |
| 87 | + virtual-fuzz: |
| 88 | + name: ZeroVirtual fuzz |
| 89 | + runs-on: ubuntu-latest |
| 90 | + container: swift:6.2.4-bookworm |
| 91 | + timeout-minutes: 60 |
| 92 | + defaults: |
| 93 | + run: |
| 94 | + working-directory: swift |
| 95 | + steps: |
| 96 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 97 | + with: |
| 98 | + persist-credentials: false |
| 99 | + - name: Install system libraries |
| 100 | + run: apt-get update && apt-get install -y --no-install-recommends libsqlite3-dev |
| 101 | + - name: Build |
| 102 | + run: swift build --build-tests |
| 103 | + # Past the PR checks' seeds (0 to 199), a new range for each run. |
| 104 | + - name: Fuzz |
| 105 | + env: |
| 106 | + ZERO_FUZZ_SEEDS: ${{ inputs.seeds || '10000' }} |
| 107 | + ZERO_FUZZ_FIRST_SEED: ${{ inputs.first-seed || format('{0}0000', github.run_number) }} |
| 108 | + run: | |
| 109 | + echo "Seeds $ZERO_FUZZ_FIRST_SEED to $((ZERO_FUZZ_FIRST_SEED + ZERO_FUZZ_SEEDS - 1))" |
| 110 | + swift test --skip-build --filter FuzzTests |
0 commit comments