Skip to content

refine fmt

refine fmt #9

Workflow file for this run

name: ZIO-HTTP Conformance Testing
on:
pull_request:
branches: ["**"]
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, Test, and Conformance
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.19, 2.13.14, 3.3.3]
java: [17, 21] # Fixed version notation
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Checkout current branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: sbt
# Step 3: Install PostgreSQL
- name: Set up PostgreSQL
run: |
sudo apt-get update
sudo apt-get install -y postgresql postgresql-contrib
sudo service postgresql start
cd /tmp
sudo -u postgres psql -c "CREATE USER testuser WITH PASSWORD 'testpassword';"
sudo -u postgres psql -c "ALTER USER testuser CREATEDB;"
sudo -u postgres psql -c "CREATE DATABASE testdb OWNER testuser;"
# Step 4: Configure environment for PostgreSQL
- name: Configure PostgreSQL Environment
run: |
echo "POSTGRES_USER=testuser" >> $GITHUB_ENV
echo "POSTGRES_PASSWORD=testpassword" >> $GITHUB_ENV
echo "POSTGRES_DB=testdb" >> $GITHUB_ENV
echo "POSTGRES_HOST=localhost" >> $GITHUB_ENV
# Step 5: Build and Test ZIO-HTTP (Include testing)
- name: Build and Test ZIO-HTTP
run: |
sbt clean compile
# sbt test
# Step 6: Run ZIO-HTTP Server in the Background (Use nohup to prevent premature exit)
- name: Run ZIO-HTTP Server
run: |
nohup sbt run &
# Step 7: Install Docker and Docker Compose (needed for local servers)
- name: Install Docker
run: |
sudo apt-get update
sudo apt-get remove -y containerd
sudo apt-get install -y docker.io docker-compose
# Step 8: Install Poetry and Dependencies
- name: Install Poetry and Dependencies
run: |
sudo apt-get install -y python3 python3-pip
pip install poetry
git clone --recurse-submodules https://github.com/cispa/http-conformance
cd http-conformance
poetry install
# Step 9: Patch dpkt Library
- name: Patch dpkt Library
run: |
cd http-conformance
sh fix_dpkt.sh
# Step 10: Start Testbed Servers (Docker Compose)
- name: Start Testbed (Docker Compose)
run: |
cd http-conformance/testbed
docker-compose up -d
docker exec testbed-jetty-1 bash -c "java -jar /usr/local/jetty/start.jar --add-modules=ssl,http2,https,test-keystore"
docker-compose restart jetty
# Step 11: Run HTTP Conformance Tests
- name: Run HTTP Conformance Tests
run: |
cd http-conformance
poetry run python run_checks.py --mode=local