Skip to content

feat: restrict login to different backend (WPB-26152) #4968

feat: restrict login to different backend (WPB-26152)

feat: restrict login to different backend (WPB-26152) #4968

name: Benchmark Checks
on:
push:
branches:
- develop
pull_request:
branches:
- develop
types: [ opened, synchronize ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # required for actions/checkout and repository metadata reads
jobs:
detekt:
name: Detekt
uses: ./.github/workflows/codestyle.yml
benchmarks-check:
name: Benchmarks Check
needs: [ detekt ]
permissions:
pull-requests: write # required for Bencher comparison comments/checks on PRs
runs-on: ubuntu-latest
container: wirebot/cryptobox:1.4.0@sha256:f0d41d90f5af96cd68a8f151fed66f83616b1b01ea6b2d71bdad319c66617e36
env:
BENCHER_PROJECT: kalium-hgtkc47o
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
persist-credentials: false
- name: Setup Java and Gradle
uses: ./.github/actions/setup-java-gradle
- name: Run Benchmarks
run: ./gradlew benchmark
- name: Generate HTML Report
run: ./gradlew jmhReport
- name: Archive Reports
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: benchmarks-reports
path: ./test/benchmarks/build/reports/benchmarks/**
- name: Create Benchmark Table
id: benchmark-table
uses: boswelja/kotlinx-benchmark-table-action@0b1ff502591bcba42a55bd052eae6a82b187968b
with:
benchmark-results: ./test/benchmarks/build/reports/benchmarks/main/**/jvm.json
- name: Post Results
run: |
echo '## Benchmarks results ⏱️' >> $GITHUB_STEP_SUMMARY
echo '${STEPS_BENCHMARK_TABLE_OUTPUTS_BENCHMARK_TABLE}️' >> $GITHUB_STEP_SUMMARY
env:
STEPS_BENCHMARK_TABLE_OUTPUTS_BENCHMARK_TABLE: ${{steps.benchmark-table.outputs.benchmark-table}}
- name: Set JMH report full path
id: path
shell: bash
run: |
REPORT_FULL_PATH_REF="$(set -- ./test/benchmarks/build/reports/benchmarks/main/**/jvm.json; echo $1)"
echo "report_full_path=$REPORT_FULL_PATH_REF" >> $GITHUB_OUTPUT
unset REPORT_FULL_PATH_REF
- name: Install bencher
uses: bencherdev/bencher@f6dd4bde2670dd4a55a6cd2ca1c7c47ecf6d5b5f
- name: Run Bencher on PR
if: github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request'
env:
GITHUB_ACTIONS_TOKEN: ${{ github.token }}
PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
STEPS_PATH_OUTPUTS_REPORT_FULL_PATH: ${{ steps.path.outputs.report_full_path }}
run: |
bencher run \
--branch '${GITHUB_HEAD_REF}' \
--branch-start-point '${GITHUB_BASE_REF}' \
--branch-start-point-hash "$PULL_REQUEST_BASE_SHA" \
--adapter java_jmh \
--testbed ubuntu-latest \
--err \
--github-actions "$GITHUB_ACTIONS_TOKEN" \
--file ${STEPS_PATH_OUTPUTS_REPORT_FULL_PATH}
- name: Run Bencher on base branch
if: github.event_name == 'push' && github.ref_name == 'develop'
run: |
bencher run \
--branch develop \
--adapter java_jmh \
--testbed ubuntu-latest \
--err \
--file ${STEPS_PATH_OUTPUTS_REPORT_FULL_PATH}
env:
STEPS_PATH_OUTPUTS_REPORT_FULL_PATH: ${{ steps.path.outputs.report_full_path }}
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties