HTTP spec conformance during CI #17128
Workflow file for this run
This file contains 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
# This file was automatically generated by sbt-github-actions using the | |
# githubWorkflowGenerate task. You should add and commit this file to | |
# your git repository. It goes without saying that you shouldn't edit | |
# this file by hand! Instead, if you wish to make changes, you should | |
# change your sbt build configuration to revise the workflow description | |
# to meet your needs, then regenerate this file. | |
name: Continuous Integration | |
on: | |
pull_request: | |
branches: ['**'] | |
types: [opened, synchronize, reopened, edited, labeled] | |
push: | |
branches: ['**'] | |
tags: [v*] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
JDK_JAVA_OPTIONS: '-Xms4G -Xmx8G -XX:+UseG1GC -Xss10M -XX:ReservedCodeCacheSize=1G -XX:NonProfiledCodeHeapSize=512m -Dfile.encoding=UTF-8' | |
SBT_OPTS: '-Xms4G -Xmx8G -XX:+UseG1GC -Xss10M -XX:ReservedCodeCacheSize=1G -XX:NonProfiledCodeHeapSize=512m -Dfile.encoding=UTF-8' | |
jobs: | |
build: | |
name: Build and Test | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.12.19, 2.13.14, 3.3.3] | |
java: | |
- graal_graalvm@17 | |
- graal_graalvm@21 | |
- temurin@17 | |
- temurin@21 | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup GraalVM (graal_graalvm@17) | |
if: matrix.java == 'graal_graalvm@17' | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: 17 | |
distribution: graalvm | |
components: native-image | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
cache: sbt | |
- name: Setup GraalVM (graal_graalvm@21) | |
if: matrix.java == 'graal_graalvm@21' | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: 21 | |
distribution: graalvm | |
components: native-image | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
cache: sbt | |
- name: Setup Java (temurin@17) | |
if: matrix.java == 'temurin@17' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: sbt | |
- name: Setup Java (temurin@21) | |
if: matrix.java == 'temurin@21' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
cache: sbt | |
- name: Check formatting | |
if: matrix.scala == '2.13.14' | |
run: sbt ++2.13.14 fmtCheck | |
- name: Check that workflows are up to date | |
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck | |
- name: Build project | |
run: sbt '++ ${{ matrix.scala }}' test | |
- name: Check doc generation | |
if: ${{ github.event_name == 'pull_request' }} | |
run: sbt ++2.13.14 doc | |
- name: zio-http-shaded Tests | |
if: matrix.scala == '2.13.14' | |
env: | |
PUBLISH_SHADED: true | |
run: sbt '++ ${{ matrix.scala }}' zioHttpShadedTests/test | |
- name: Compress target directories | |
run: tar cf targets.tar sbt-zio-http-grpc/target zio-http-cli/target target zio-http/jvm/target zio-http-docs/target sbt-zio-http-grpc-tests/target zio-http-gen/target zio-http-benchmarks/target zio-http-tools/target zio-http-example/target zio-http-testkit/target zio-http/js/target zio-http-htmx/target project/target | |
- name: Upload target directories | |
uses: actions/upload-artifact@v4 | |
with: | |
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} | |
path: targets.tar | |
publish: | |
name: Publish Artifacts | |
needs: [build] | |
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [graal_graalvm@17] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup GraalVM (graal_graalvm@17) | |
if: matrix.java == 'graal_graalvm@17' | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: 17 | |
distribution: graalvm | |
components: native-image | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
cache: sbt | |
- name: Setup GraalVM (graal_graalvm@21) | |
if: matrix.java == 'graal_graalvm@21' | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: 21 | |
distribution: graalvm | |
components: native-image | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
cache: sbt | |
- name: Setup Java (temurin@17) | |
if: matrix.java == 'temurin@17' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: sbt | |
- name: Setup Java (temurin@21) | |
if: matrix.java == 'temurin@21' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
cache: sbt | |
- name: Download target directories (2.12.19) | |
uses: actions/download-artifact@v4 | |
with: | |
name: target-${{ matrix.os }}-2.12.19-${{ matrix.java }} | |
- name: Inflate target directories (2.12.19) | |
run: | | |
tar xf targets.tar | |
rm targets.tar | |
- name: Download target directories (2.13.14) | |
uses: actions/download-artifact@v4 | |
with: | |
name: target-${{ matrix.os }}-2.13.14-${{ matrix.java }} | |
- name: Inflate target directories (2.13.14) | |
run: | | |
tar xf targets.tar | |
rm targets.tar | |
- name: Download target directories (3.3.3) | |
uses: actions/download-artifact@v4 | |
with: | |
name: target-${{ matrix.os }}-3.3.3-${{ matrix.java }} | |
- name: Inflate target directories (3.3.3) | |
run: | | |
tar xf targets.tar | |
rm targets.tar | |
- name: Release | |
env: | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
CI_SONATYPE_RELEASE: ${{ secrets.CI_SONATYPE_RELEASE }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
run: sbt ci-release | |
- name: Release Shaded | |
env: | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
PUBLISH_SHADED: true | |
CI_SONATYPE_RELEASE: ${{ secrets.CI_SONATYPE_RELEASE }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
run: sbt ci-release | |
update_release_draft: | |
name: Release Drafter | |
if: ${{ github.base_ref == 'main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.10] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: release-drafter/release-drafter@v5 | |
mima_check: | |
name: Mima Check | |
if: ${{ github.event_name == 'pull_request' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.10] | |
java: [temurin@21] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Java (temurin@21) | |
if: matrix.java == 'temurin@21' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
cache: sbt | |
- run: sbt mimaChecks | |
unsafeRunScoverage: | |
name: Unsafe Scoverage | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Add Scoverage | |
id: add_plugin | |
run: sed -i -e '$aaddSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12")' project/plugins.sbt | |
- name: Update Build Definition | |
id: update_build_definition | |
run: | | |
sed -i -e 's+(project in file("./zio-http"))+(project in file("./zio-http")).settings(coverageEnabled:=true,coverageMinimumStmtTotal:=50.0,coverageMinimumBranchTotal:=60.0)+g' build.sbt | |
- name: Run Coverage | |
id: run_coverage | |
run: sbt 'coverage; project zioHttpJVM; test; coverageReport' | |
- name: Push Codecov | |
id: push_codecov | |
run: 'bash <(curl -s https://codecov.io/bash)' | |
Jmh_CachedDateHeaderBenchmark: | |
name: Jmh CachedDateHeaderBenchmark | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_CachedDateHeaderBenchmark.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 CachedDateHeaderBenchmark" | grep -e "thrpt" -e "avgt" >> ../Main_CachedDateHeaderBenchmark.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_CachedDateHeaderBenchmark | |
path: Main_CachedDateHeaderBenchmark.txt | |
Jmh_ClientBenchmark: | |
name: Jmh ClientBenchmark | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_ClientBenchmark.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 ClientBenchmark" | grep -e "thrpt" -e "avgt" >> ../Main_ClientBenchmark.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_ClientBenchmark | |
path: Main_ClientBenchmark.txt | |
Jmh_CookieDecodeBenchmark: | |
name: Jmh CookieDecodeBenchmark | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_CookieDecodeBenchmark.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 CookieDecodeBenchmark" | grep -e "thrpt" -e "avgt" >> ../Main_CookieDecodeBenchmark.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_CookieDecodeBenchmark | |
path: Main_CookieDecodeBenchmark.txt | |
Jmh_EndpointBenchmark: | |
name: Jmh EndpointBenchmark | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_EndpointBenchmark.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 EndpointBenchmark" | grep -e "thrpt" -e "avgt" >> ../Main_EndpointBenchmark.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_EndpointBenchmark | |
path: Main_EndpointBenchmark.txt | |
Jmh_HttpCollectEval: | |
name: Jmh HttpCollectEval | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_HttpCollectEval.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 HttpCollectEval" | grep -e "thrpt" -e "avgt" >> ../Main_HttpCollectEval.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_HttpCollectEval | |
path: Main_HttpCollectEval.txt | |
Jmh_HttpCombineEval: | |
name: Jmh HttpCombineEval | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_HttpCombineEval.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 HttpCombineEval" | grep -e "thrpt" -e "avgt" >> ../Main_HttpCombineEval.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_HttpCombineEval | |
path: Main_HttpCombineEval.txt | |
Jmh_HttpNestedFlatMapEval: | |
name: Jmh HttpNestedFlatMapEval | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_HttpNestedFlatMapEval.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 HttpNestedFlatMapEval" | grep -e "thrpt" -e "avgt" >> ../Main_HttpNestedFlatMapEval.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_HttpNestedFlatMapEval | |
path: Main_HttpNestedFlatMapEval.txt | |
Jmh_HttpRouteTextPerf: | |
name: Jmh HttpRouteTextPerf | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_HttpRouteTextPerf.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 HttpRouteTextPerf" | grep -e "thrpt" -e "avgt" >> ../Main_HttpRouteTextPerf.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_HttpRouteTextPerf | |
path: Main_HttpRouteTextPerf.txt | |
Jmh_ProbeContentTypeBenchmark: | |
name: Jmh ProbeContentTypeBenchmark | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_ProbeContentTypeBenchmark.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 ProbeContentTypeBenchmark" | grep -e "thrpt" -e "avgt" >> ../Main_ProbeContentTypeBenchmark.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_ProbeContentTypeBenchmark | |
path: Main_ProbeContentTypeBenchmark.txt | |
Jmh_SchemeDecodeBenchmark: | |
name: Jmh SchemeDecodeBenchmark | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_SchemeDecodeBenchmark.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 SchemeDecodeBenchmark" | grep -e "thrpt" -e "avgt" >> ../Main_SchemeDecodeBenchmark.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_SchemeDecodeBenchmark | |
path: Main_SchemeDecodeBenchmark.txt | |
Jmh_ServerInboundHandlerBenchmark: | |
name: Jmh ServerInboundHandlerBenchmark | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_ServerInboundHandlerBenchmark.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 ServerInboundHandlerBenchmark" | grep -e "thrpt" -e "avgt" >> ../Main_ServerInboundHandlerBenchmark.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_ServerInboundHandlerBenchmark | |
path: Main_ServerInboundHandlerBenchmark.txt | |
Jmh_UtilBenchmark: | |
name: Jmh UtilBenchmark | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Benchmark_Main | |
id: Benchmark_Main | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
cd zio-http | |
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt | |
cat > Main_UtilBenchmark.txt | |
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 UtilBenchmark" | grep -e "thrpt" -e "avgt" >> ../Main_UtilBenchmark.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Jmh_Main_UtilBenchmark | |
path: Main_UtilBenchmark.txt | |
Jmh_cache: | |
name: Cache Jmh benchmarks | |
needs: [Jmh_CachedDateHeaderBenchmark, Jmh_ClientBenchmark, Jmh_CookieDecodeBenchmark, Jmh_EndpointBenchmark, Jmh_HttpCollectEval, Jmh_HttpCombineEval, Jmh_HttpNestedFlatMapEval, Jmh_HttpRouteTextPerf, Jmh_ProbeContentTypeBenchmark, Jmh_SchemeDecodeBenchmark, Jmh_ServerInboundHandlerBenchmark, Jmh_UtilBenchmark] | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.10] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_CachedDateHeaderBenchmark | |
- name: Format_Main_CachedDateHeaderBenchmark | |
run: cat Main_CachedDateHeaderBenchmark.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_ClientBenchmark | |
- name: Format_Main_ClientBenchmark | |
run: cat Main_ClientBenchmark.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_CookieDecodeBenchmark | |
- name: Format_Main_CookieDecodeBenchmark | |
run: cat Main_CookieDecodeBenchmark.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_EndpointBenchmark | |
- name: Format_Main_EndpointBenchmark | |
run: cat Main_EndpointBenchmark.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_HttpCollectEval | |
- name: Format_Main_HttpCollectEval | |
run: cat Main_HttpCollectEval.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_HttpCombineEval | |
- name: Format_Main_HttpCombineEval | |
run: cat Main_HttpCombineEval.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_HttpNestedFlatMapEval | |
- name: Format_Main_HttpNestedFlatMapEval | |
run: cat Main_HttpNestedFlatMapEval.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_HttpRouteTextPerf | |
- name: Format_Main_HttpRouteTextPerf | |
run: cat Main_HttpRouteTextPerf.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_ProbeContentTypeBenchmark | |
- name: Format_Main_ProbeContentTypeBenchmark | |
run: cat Main_ProbeContentTypeBenchmark.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_SchemeDecodeBenchmark | |
- name: Format_Main_SchemeDecodeBenchmark | |
run: cat Main_SchemeDecodeBenchmark.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_ServerInboundHandlerBenchmark | |
- name: Format_Main_ServerInboundHandlerBenchmark | |
run: cat Main_ServerInboundHandlerBenchmark.txt >> Main_benchmarks.txt | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Jmh_Main_UtilBenchmark | |
- name: Format_Main_UtilBenchmark | |
run: cat Main_UtilBenchmark.txt >> Main_benchmarks.txt | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- name: Main Result | |
id: Main_Result | |
run: | | |
while IFS= read -r line; do | |
IFS=' ' read -ra PARSED_RESULT <<< "$line" | |
echo ${PARSED_RESULT[1]} >> parsed_Main.txt | |
B_VALUE=$(echo ${PARSED_RESULT[1]}": "${PARSED_RESULT[4]}" ops/sec") | |
echo $B_VALUE >> Main.txt | |
done < Main_benchmarks.txt | |
- uses: actions/cache@v4 | |
with: | |
path: Main.txt | |
key: jmh_benchmarks_${{ github.sha }} | |
runBenchmarks-simple: | |
name: Performance Benchmarks (PlainTextBenchmarkServer) | |
if: ${{ github.event_name == 'pull_request'}} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Clean up | |
id: clean_up | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: sudo rm -rf * | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/checkout@v2 | |
with: | |
repository: khajavi/FrameworkBenchmarks | |
path: FrameworkBenchMarks | |
- id: result | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
mkdir -p ./FrameworkBenchMarks/frameworks/Scala/zio-http/src/main/scala | |
cp ./zio-http/zio-http-example/src/main/scala/example/PlainTextBenchmarkServer.scala ./FrameworkBenchMarks/frameworks/Scala/zio-http/src/main/scala/Main.scala | |
cd ./FrameworkBenchMarks | |
cd ./frameworks/Scala/zio-http | |
git init . | |
git config user.email 'benchamrk@example.com' | |
git config user.name 'ZIO Benchmark' | |
git add build.sbt | |
git commit -m 'initial commit' | |
git tag v1.0.0 | |
git clone https://github.com/${{github.event.pull_request.head.repo.owner.login}}/zio-http.git | |
cd zio-http | |
git checkout ${{github.event.pull_request.head.sha}} | |
cd ../../../.. | |
./tfb --test zio-http | tee result | |
RESULT_REQUEST=$(echo $(grep -B 1 -A 17 "Concurrency: 256 for plaintext" result) | grep -oiE "requests/sec: [0-9]+.[0-9]+" | grep -oiE "[0-9]+" | head -1) | |
RESULT_CONCURRENCY=$(echo $(grep -B 1 -A 17 "Concurrency: 256 for plaintext" result) | grep -oiE "concurrency: [0-9]+" | grep -oiE "[0-9]+") | |
echo "request_per_second=$RESULT_REQUEST" >> $GITHUB_OUTPUT | |
echo "concurrency=$RESULT_CONCURRENCY" >> $GITHUB_OUTPUT | |
- if: ${{github.event.pull_request.head.repo.full_name == 'zio/zio-http'}} | |
uses: peter-evans/commit-comment@v2 | |
with: | |
sha: ${{github.event.pull_request.head.sha}} | |
body: | | |
**🚀 :** Performance Benchmarks (PlainTextBenchmarkServer) | |
concurrency: ${{steps.result.outputs.concurrency}} | |
requests/sec: ${{steps.result.outputs.request_per_second}} | |
- name: Performance Report | |
id: perf-report | |
env: | |
REQUESTS_PER_SECOND: ${{steps.result.outputs.request_per_second}} | |
CONCURRENCY: ${{steps.result.outputs.concurrency}} | |
PERFORMANCE_FLOOR: 300000 | |
run: | | |
echo "** 🚀 Performance Benchmarks (PlainTextBenchmarkServer) Report 🚀 **" | |
echo "$REQUESTS_PER_SECOND requests/sec for $CONCURRENCY concurrent requests" | |
if (( REQUESTS_PER_SECOND > PERFORMANCE_FLOOR )); then | |
echo "Woohoo! Performance is good! $REQUESTS_PER_SECOND requests/sec exceeds the performance floor of $PERFORMANCE_FLOOR requests/sec." | |
else | |
echo "Performance benchmark failed with $REQUESTS_PER_SECOND req/sec! Performance must exceed $PERFORMANCE_FLOOR req/sec." | |
exit 1 | |
fi | |
runBenchmarks-effectful: | |
name: Performance Benchmarks (SimpleEffectBenchmarkServer) | |
if: ${{ github.event_name == 'pull_request'}} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
scala: [2.13.14] | |
java: [temurin@8] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Clean up | |
id: clean_up | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: sudo rm -rf * | |
- uses: actions/checkout@v2 | |
with: | |
path: zio-http | |
- uses: actions/checkout@v2 | |
with: | |
repository: khajavi/FrameworkBenchmarks | |
path: FrameworkBenchMarks | |
- id: result | |
env: | |
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}} | |
run: | | |
mkdir -p ./FrameworkBenchMarks/frameworks/Scala/zio-http/src/main/scala | |
cp ./zio-http/zio-http-example/src/main/scala/example/SimpleEffectBenchmarkServer.scala ./FrameworkBenchMarks/frameworks/Scala/zio-http/src/main/scala/Main.scala | |
cd ./FrameworkBenchMarks | |
cd ./frameworks/Scala/zio-http | |
git init . | |
git config user.email 'benchamrk@example.com' | |
git config user.name 'ZIO Benchmark' | |
git add build.sbt | |
git commit -m 'initial commit' | |
git tag v1.0.0 | |
git clone https://github.com/${{github.event.pull_request.head.repo.owner.login}}/zio-http.git | |
cd zio-http | |
git checkout ${{github.event.pull_request.head.sha}} | |
cd ../../../.. | |
./tfb --test zio-http | tee result | |
RESULT_REQUEST=$(echo $(grep -B 1 -A 17 "Concurrency: 256 for plaintext" result) | grep -oiE "requests/sec: [0-9]+.[0-9]+" | grep -oiE "[0-9]+" | head -1) | |
RESULT_CONCURRENCY=$(echo $(grep -B 1 -A 17 "Concurrency: 256 for plaintext" result) | grep -oiE "concurrency: [0-9]+" | grep -oiE "[0-9]+") | |
echo "request_per_second=$RESULT_REQUEST" >> $GITHUB_OUTPUT | |
echo "concurrency=$RESULT_CONCURRENCY" >> $GITHUB_OUTPUT | |
- if: ${{github.event.pull_request.head.repo.full_name == 'zio/zio-http'}} | |
uses: peter-evans/commit-comment@v2 | |
with: | |
sha: ${{github.event.pull_request.head.sha}} | |
body: | | |
**🚀 :** Performance Benchmarks (SimpleEffectBenchmarkServer) | |
concurrency: ${{steps.result.outputs.concurrency}} | |
requests/sec: ${{steps.result.outputs.request_per_second}} | |
- name: Performance Report | |
id: perf-report | |
env: | |
REQUESTS_PER_SECOND: ${{steps.result.outputs.request_per_second}} | |
CONCURRENCY: ${{steps.result.outputs.concurrency}} | |
PERFORMANCE_FLOOR: 300000 | |
run: | | |
echo "** 🚀 Performance Benchmarks (SimpleEffectBenchmarkServer) Report 🚀 **" | |
echo "$REQUESTS_PER_SECOND requests/sec for $CONCURRENCY concurrent requests" | |
if (( REQUESTS_PER_SECOND > PERFORMANCE_FLOOR )); then | |
echo "Woohoo! Performance is good! $REQUESTS_PER_SECOND requests/sec exceeds the performance floor of $PERFORMANCE_FLOOR requests/sec." | |
else | |
echo "Performance benchmark failed with $REQUESTS_PER_SECOND req/sec! Performance must exceed $PERFORMANCE_FLOOR req/sec." | |
exit 1 | |
fi |