test: Refactor Existing k6 Tests to Measure Accurately
#5364
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-License-Identifier: Apache-2.0 | |
| name: "PR Checks" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/* | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| GRADLE_EXEC: "ionice -c 2 -n 2 nice -n 19 ./gradlew " | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: write | |
| jobs: | |
| package-protobuf-source: | |
| timeout-minutes: 5 | |
| runs-on: hiero-block-node-linux-medium | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract version | |
| id: extract_version | |
| run: | | |
| VERSION=$(cat version.txt) | |
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 | |
| with: | |
| distribution: "temurin" | |
| java-version: "21.0.6" | |
| - name: Produce artifact | |
| run: ${GRADLE_EXEC} :protobuf-sources:generateBlockNodeProtoArtifact | |
| compile: | |
| timeout-minutes: 20 | |
| name: "Quality Checks and UTs" | |
| runs-on: hiero-block-node-linux-medium | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout code | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Expand Shallow Clone for Spotless | |
| run: | | |
| if [ -f .git/shallow ]; then | |
| git fetch --unshallow --no-recurse-submodules | |
| else | |
| echo "Repository is not shallow, no need to unshallow." | |
| fi | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 | |
| with: | |
| distribution: "temurin" | |
| java-version: "21.0.6" | |
| - name: Build | |
| id: gradle-build | |
| run: ${GRADLE_EXEC} clean assemble | |
| - name: Style Check | |
| id: spotless-check | |
| run: ${GRADLE_EXEC} qualityCheck --continue | |
| - name: Unit Tests | |
| id: unit-tests | |
| run: ${GRADLE_EXEC} check | |
| - name: Upload coverage report | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: gradle/aggregation/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml |