| 1 | name: Benchmarks |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - "main" |
| 7 | pull_request: |
| 8 | workflow_dispatch: |
| 9 | |
| 10 | jobs: |
| 11 | benchmarks: |
| 12 | name: Run Benchmarks |
| 13 | runs-on: ubuntu-latest |
| 14 | permissions: |
| 15 | contents: read |
| 16 | id-token: write |
| 17 | strategy: |
| 18 | matrix: |
| 19 | benchmark: |
| 20 | - crypto_bench |
| 21 | - event_cache |
| 22 | - linked_chunk |
| 23 | - store_bench |
| 24 | - timeline |
| 25 | - room_list |
| 26 | |
| 27 | steps: |
| 28 | # This CI workflow can run into space issue, so we're cleaning up some |
| 29 | # space here. |
| 30 | - name: Create some more space |
| 31 | run: | |
| 32 | echo "Disk space before cleanup" |
| 33 | df -h |
| 34 | |
| 35 | cd /opt |
| 36 | find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';' |
| 37 | rm -rf /opt/hostedtoolcache |
| 38 | |
| 39 | # Get rid of binaries and libs we're not interested in. |
| 40 | sudo rm -rf \ |
| 41 | /usr/local/julia* \ |
| 42 | /usr/local/aws* |
| 43 | |
| 44 | sudo rm -rf \ |
| 45 | /usr/local/bin/minikube \ |
| 46 | /usr/local/bin/node \ |
| 47 | /usr/local/bin/stack \ |
| 48 | /usr/local/bin/bicep \ |
| 49 | /usr/local/bin/pulumi* \ |
| 50 | /usr/local/bin/helm \ |
| 51 | /usr/local/bin/azcopy \ |
| 52 | /usr/local/bin/packer \ |
| 53 | /usr/local/bin/cmake-gui \ |
| 54 | /usr/local/bin/cpack |
| 55 | |
| 56 | sudo rm -rf \ |
| 57 | /usr/local/share/powershell \ |
| 58 | /usr/local/share/chromium |
| 59 | |
| 60 | sudo rm -rf /usr/local/lib/android |
| 61 | |
| 62 | echo "::group::/usr/local/bin/*" |
| 63 | du -hsc /usr/local/bin/* | sort -h |
| 64 | echo "::endgroup::" |
| 65 | |
| 66 | echo "::group::/usr/local/share/*" |
| 67 | du -hsc /usr/local/share/* | sort -h |
| 68 | echo "::endgroup::" |
| 69 | |
| 70 | echo "::group::/usr/local/*" |
| 71 | du -hsc /usr/local/* | sort -h |
| 72 | echo "::endgroup::" |
| 73 | |
| 74 | echo "::group::/usr/local/lib/*" |
| 75 | du -hsc /usr/local/lib/* | sort -h |
| 76 | echo "::endgroup::" |
| 77 | |
| 78 | echo "::group::/opt/*" |
| 79 | du -hsc /opt/* | sort -h |
| 80 | echo "::endgroup::" |
| 81 | |
| 82 | echo "Disk space after cleanup" |
| 83 | df -h |
| 84 | |
| 85 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| 86 | with: |
| 87 | persist-credentials: false |
| 88 | |
| 89 | - name: Setup rust toolchain, cache and cargo-codspeed binary |
| 90 | uses: moonrepo/setup-rust@abb2d32350334249b178c401e5ec5836e0cd88d3 |
| 91 | with: |
| 92 | channel: stable |
| 93 | cache-target: release |
| 94 | bins: cargo-codspeed |
| 95 | |
| 96 | - name: Build the benchmark target(s) |
| 97 | run: cargo codspeed build -p benchmarks --bench ${{ matrix.benchmark }} --features codspeed |
| 98 | |
| 99 | - name: Run the benchmarks |
| 100 | uses: CodSpeedHQ/action@3194d9a39c4d46684cb44bf7207fc56626aad8fd |
| 101 | with: |
| 102 | run: cargo codspeed run |
| 103 | mode: simulation |