|
| 1 | +name: Large monorepos |
| 2 | + |
| 3 | +# Observational nightly: check out the five pinned public monorepos, scan each offline, |
| 4 | +# and publish wall time and peak RSS to the job summary and an artifact. Not a required check. |
| 5 | + |
| 6 | +on: |
| 7 | + schedule: |
| 8 | + # Nightly (after mutation at :47 past 4 UTC). |
| 9 | + - cron: "11 5 * * *" |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: large-monorepos-${{ github.workflow }}-${{ github.ref }} |
| 17 | + cancel-in-progress: false |
| 18 | + |
| 19 | +jobs: |
| 20 | + matrix: |
| 21 | + name: read suite pins |
| 22 | + runs-on: ubuntu-latest |
| 23 | + timeout-minutes: 5 |
| 24 | + outputs: |
| 25 | + targets: ${{ steps.read.outputs.targets }} |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 |
| 28 | + with: |
| 29 | + persist-credentials: false |
| 30 | + - id: read |
| 31 | + name: Emit the suite matrix from benchmarks/large-monorepos.json |
| 32 | + run: | |
| 33 | + targets="$(jq -c '.repositories' benchmarks/large-monorepos.json)" |
| 34 | + count="$(jq '.repositories | length' benchmarks/large-monorepos.json)" |
| 35 | + if [ "$count" != "5" ]; then |
| 36 | + echo "::error::suite must list exactly five repositories (found $count)" |
| 37 | + exit 1 |
| 38 | + fi |
| 39 | + echo "targets=$targets" >> "$GITHUB_OUTPUT" |
| 40 | +
|
| 41 | + measure: |
| 42 | + name: measure (${{ matrix.target.id }}) |
| 43 | + needs: matrix |
| 44 | + runs-on: ubuntu-latest |
| 45 | + timeout-minutes: 45 |
| 46 | + strategy: |
| 47 | + fail-fast: false |
| 48 | + matrix: |
| 49 | + target: ${{ fromJson(needs.matrix.outputs.targets) }} |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 |
| 52 | + with: |
| 53 | + persist-credentials: false |
| 54 | + - uses: $/.github/actions/setup |
| 55 | + with: |
| 56 | + cache: npm |
| 57 | + - name: Build the large-monorepo harness |
| 58 | + run: npm run build --silent |
| 59 | + - name: Check out ${{ matrix.target.repository }} at the pinned commit |
| 60 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 |
| 61 | + with: |
| 62 | + repository: ${{ matrix.target.repository }} |
| 63 | + ref: ${{ matrix.target.commit }} |
| 64 | + path: targets/${{ matrix.target.id }} |
| 65 | + persist-credentials: false |
| 66 | + - name: Record scan time and peak memory |
| 67 | + run: | |
| 68 | + mkdir -p artifacts |
| 69 | + node dist/benchmarks/large-monorepos.js \ |
| 70 | + --root targets \ |
| 71 | + --only "${{ matrix.target.id }}" \ |
| 72 | + --warmup 0 \ |
| 73 | + --runs 1 \ |
| 74 | + --json \ |
| 75 | + --output "artifacts/${{ matrix.target.id }}.json" |
| 76 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 |
| 77 | + with: |
| 78 | + name: large-monorepo-${{ matrix.target.id }} |
| 79 | + path: artifacts/${{ matrix.target.id }}.json |
| 80 | + if-no-files-found: error |
| 81 | + retention-days: 14 |
| 82 | + |
| 83 | + publish: |
| 84 | + name: publish suite results |
| 85 | + needs: measure |
| 86 | + if: always() && needs.measure.result != 'cancelled' |
| 87 | + runs-on: ubuntu-latest |
| 88 | + timeout-minutes: 10 |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 |
| 91 | + with: |
| 92 | + persist-credentials: false |
| 93 | + - uses: $/.github/actions/setup |
| 94 | + with: |
| 95 | + cache: npm |
| 96 | + - name: Build the merge helper |
| 97 | + run: npm run build --silent |
| 98 | + - name: Download per-repository measurements |
| 99 | + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 |
| 100 | + with: |
| 101 | + pattern: large-monorepo-* |
| 102 | + path: shard-results |
| 103 | + merge-multiple: true |
| 104 | + - name: Merge results into the job summary and artifact |
| 105 | + run: | |
| 106 | + mkdir -p artifacts |
| 107 | + node dist/benchmarks/large-monorepos.js \ |
| 108 | + --merge shard-results \ |
| 109 | + --output artifacts/large-monorepos.json \ |
| 110 | + --summary "$GITHUB_STEP_SUMMARY" |
| 111 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 |
| 112 | + with: |
| 113 | + name: large-monorepos-${{ github.run_id }} |
| 114 | + path: artifacts/large-monorepos.json |
| 115 | + if-no-files-found: error |
| 116 | + retention-days: 30 |
0 commit comments