Refactor Scala client, server Github workflow for testing (#22005)

* refactor scala client server workflow for testing

* fix

* migrate circleci scala tests

* add service, update host table

* java 8

* add distribution

* java 17

* 2.13.x

* update

* clean up circleci config
This commit is contained in:
William Cheng 2025-09-21 16:27:03 +08:00 committed by GitHub
parent 71a6901d1e
commit 24d7c3e904
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 77 additions and 16 deletions

View File

@ -0,0 +1,70 @@
name: Samples Scala/sbt client
on:
push:
paths:
- samples/client/petstore/scalaz/**
- samples/client/petstore/scala-pekko/**
- samples/client/petstore/scala-http4s/**
- samples/client/petstore/scala-sttp4-jsoniter/**
- samples/client/petstore/scala-akka/**
- samples/client/petstore/scala-sttp/**
- samples/client/petstore/scala-sttp-circe/**
- samples/client/petstore/scala-sttp4/**
pull_request:
paths:
- samples/client/petstore/scalaz/**
- samples/client/petstore/scala-pekko/**
- samples/client/petstore/scala-http4s/**
- samples/client/petstore/scala-sttp4-jsoniter/**
- samples/client/petstore/scala-akka/**
- samples/client/petstore/scala-sttp/**
- samples/client/petstore/scala-sttp-circe/**
- samples/client/petstore/scala-sttp4/**
jobs:
build:
name: Build sbt/Scala
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
# clients
- samples/client/petstore/scalaz
- samples/client/petstore/scala-pekko
- samples/client/petstore/scala-http4s
- samples/client/petstore/scala-sttp4-jsoniter
- samples/client/petstore/scala-akka
- samples/client/petstore/scala-sttp
- samples/client/petstore/scala-sttp-circe
- samples/client/petstore/scala-sttp4
services:
petstore-api:
image: swaggerapi/petstore
ports:
- 80:8080
env:
SWAGGER_HOST: http://petstore.swagger.io
SWAGGER_BASE_PATH: /v2
steps:
- uses: actions/checkout@v5
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 11
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Cache maven dependencies
uses: actions/cache@v4
env:
cache-name: maven-repository
with:
path: |
~/.ivy2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/build.sbt') }}
- name: Build and test
working-directory: ${{ matrix.sample }}
run: sbt -v test

View File

@ -1,29 +1,20 @@
name: Samples Scala/sbt
name: Samples Scala/sbt server
on:
push:
paths:
- 'samples/client/petstore/scala**'
- 'samples/server/petstore/scala**'
pull_request:
paths:
- 'samples/client/petstore/scala**'
- 'samples/server/petstore/scala**'
jobs:
build:
name: Build sbt/Scala client, servers
name: Build sbt/Scala
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
# clients
- samples/client/petstore/scalaz
- samples/client/petstore/scala-pekko
- samples/client/petstore/scala-http4s
- samples/client/petstore/scala-sttp4-jsoniter
#- samples/client/petstore/scala-sttp
#- samples/client/petstore/scala-sttp-circe
# servers
- samples/server/petstore/scala-play-server
- samples/server/petstore/scala-akka-http-server

View File

@ -116,9 +116,4 @@ else
echo "Running node $NODE_INDEX ..."
java -version
(cd samples/client/petstore/scala-akka && mvn integration-test)
(cd samples/client/petstore/scala-sttp && mvn integration-test)
(cd samples/client/petstore/scala-sttp-circe && mvn integration-test)
(cd samples/client/petstore/scala-sttp4 && mvn integration-test)
fi

View File

@ -22,3 +22,5 @@
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
pom.xml

View File

@ -21,3 +21,6 @@
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
#
#
#