name: Networking Benchmarks on: workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true permissions: contents: read jobs: preflight: uses: ./.github/workflows/reusable-preflight.yml build: timeout-minutes: 50 needs: [preflight] runs-on: ${{ needs.preflight.outputs.RUNNER_BENCHMARK }} container: image: ${{ needs.preflight.outputs.IMAGE }} strategy: fail-fast: false matrix: features: [ { bench: "notifications_protocol" }, { bench: "request_response_protocol" }, ] steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run Benchmarks id: run-benchmarks run: | mkdir -p ./charts cargo bench -p pezsc-network --bench ${{ matrix.features.bench }} -- --output-format bencher | grep "^test" | tee ./charts/${{ matrix.features.bench }}.txt || echo "Benchmarks failed" ls -lsa ./charts - name: Upload artifacts uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: ${{ matrix.features.bench }}-${{ github.sha }} path: ./charts publish-benchmarks: timeout-minutes: 60 needs: [build] if: github.ref == 'refs/heads/master' environment: subsystem-benchmarks runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: gh-pages fetch-depth: 0 - run: git checkout master -- - name: Download artifacts uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: name: notifications_protocol-${{ github.sha }} path: ./charts - name: Download artifacts uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: name: request_response_protocol-${{ github.sha }} path: ./charts - name: Setup git run: | # Fixes "detected dubious ownership" error in the ci git config --global --add safe.directory '*' ls -lsR ./charts - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 id: app-token with: app-id: ${{ secrets.PEZKUWI_GHPAGES_APP_ID }} private-key: ${{ secrets.PEZKUWI_GHPAGES_APP_KEY }} - name: Generate ${{ env.BENCH }} env: BENCH: notifications_protocol uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0 with: tool: "cargo" name: ${{ env.BENCH }} output-file-path: ./charts/${{ env.BENCH }}.txt benchmark-data-dir-path: ./bench/${{ env.BENCH }} github-token: ${{ steps.app-token.outputs.token }} auto-push: true - name: Generate ${{ env.BENCH }} env: BENCH: request_response_protocol uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0 with: tool: "cargo" name: ${{ env.BENCH }} output-file-path: ./charts/${{ env.BENCH }}.txt benchmark-data-dir-path: ./bench/${{ env.BENCH }} github-token: ${{ steps.app-token.outputs.token }} auto-push: true