Skip to content

Documentation of Middleware and HandlerAspect #15414

Documentation of Middleware and HandlerAspect

Documentation of Middleware and HandlerAspect #15414

Workflow file for this run

# 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 }}
jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.18, 2.13.12, 3.3.1]
java: [graal_graalvm@17, temurin@8]
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 Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
cache: sbt
- name: Check formatting
if: matrix.scala == '2.13.12'
run: sbt ++2.13.12 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.12 doc
- name: zio-http-shaded Tests
if: matrix.scala == '2.13.12'
env:
PUBLISH_SHADED: true
run: sbt '++ ${{ matrix.scala }}' zioHttpShadedTests/test
- name: Compress target directories
run: tar cf targets.tar zio-http-cli/target target zio-http/jvm/target zio-http-docs/target zio-http-gen/target zio-http-benchmarks/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.12]
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 Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
cache: sbt
- name: Download target directories (2.12.18)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-2.12.18-${{ matrix.java }}
- name: Inflate target directories (2.12.18)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.12)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-2.13.12-${{ matrix.java }}
- name: Inflate target directories (2.13.12)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.3.1)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-3.3.1-${{ matrix.java }}
- name: Inflate target directories (3.3.1)
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
unsafeRunScoverage:
name: Unsafe Scoverage
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.12]
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.9")' 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_CookieDecodeBenchmark:
name: Jmh CookieDecodeBenchmark
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.12]
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.3")' 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.12]
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.3")' 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.12]
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.3")' 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.12]
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.3")' 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.12]
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.3")' 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.12]
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.3")' 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.12]
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.3")' 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.12]
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.3")' 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.12]
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.3")' 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.12]
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.3")' 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_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_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 }}