Skip to content

Commit 24d7c3e

Browse files
authored
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
1 parent 71a6901 commit 24d7c3e

File tree

5 files changed

+77
-16
lines changed

5 files changed

+77
-16
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Samples Scala/sbt client
2+
3+
on:
4+
push:
5+
paths:
6+
- samples/client/petstore/scalaz/**
7+
- samples/client/petstore/scala-pekko/**
8+
- samples/client/petstore/scala-http4s/**
9+
- samples/client/petstore/scala-sttp4-jsoniter/**
10+
- samples/client/petstore/scala-akka/**
11+
- samples/client/petstore/scala-sttp/**
12+
- samples/client/petstore/scala-sttp-circe/**
13+
- samples/client/petstore/scala-sttp4/**
14+
pull_request:
15+
paths:
16+
- samples/client/petstore/scalaz/**
17+
- samples/client/petstore/scala-pekko/**
18+
- samples/client/petstore/scala-http4s/**
19+
- samples/client/petstore/scala-sttp4-jsoniter/**
20+
- samples/client/petstore/scala-akka/**
21+
- samples/client/petstore/scala-sttp/**
22+
- samples/client/petstore/scala-sttp-circe/**
23+
- samples/client/petstore/scala-sttp4/**
24+
jobs:
25+
build:
26+
name: Build sbt/Scala
27+
runs-on: ubuntu-latest
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
sample:
32+
# clients
33+
- samples/client/petstore/scalaz
34+
- samples/client/petstore/scala-pekko
35+
- samples/client/petstore/scala-http4s
36+
- samples/client/petstore/scala-sttp4-jsoniter
37+
- samples/client/petstore/scala-akka
38+
- samples/client/petstore/scala-sttp
39+
- samples/client/petstore/scala-sttp-circe
40+
- samples/client/petstore/scala-sttp4
41+
services:
42+
petstore-api:
43+
image: swaggerapi/petstore
44+
ports:
45+
- 80:8080
46+
env:
47+
SWAGGER_HOST: http://petstore.swagger.io
48+
SWAGGER_BASE_PATH: /v2
49+
steps:
50+
- uses: actions/checkout@v5
51+
- name: Add hosts to /etc/hosts
52+
run: |
53+
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
54+
- uses: actions/setup-java@v5
55+
with:
56+
distribution: 'temurin'
57+
java-version: 11
58+
- name: Setup sbt launcher
59+
uses: sbt/setup-sbt@v1
60+
- name: Cache maven dependencies
61+
uses: actions/cache@v4
62+
env:
63+
cache-name: maven-repository
64+
with:
65+
path: |
66+
~/.ivy2
67+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/build.sbt') }}
68+
- name: Build and test
69+
working-directory: ${{ matrix.sample }}
70+
run: sbt -v test

.github/workflows/samples-scala.yaml renamed to .github/workflows/samples-scala-server.yaml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
1-
name: Samples Scala/sbt
1+
name: Samples Scala/sbt server
22

33
on:
44
push:
55
paths:
6-
- 'samples/client/petstore/scala**'
76
- 'samples/server/petstore/scala**'
87
pull_request:
98
paths:
10-
- 'samples/client/petstore/scala**'
119
- 'samples/server/petstore/scala**'
1210
jobs:
1311
build:
14-
name: Build sbt/Scala client, servers
12+
name: Build sbt/Scala
1513
runs-on: ubuntu-latest
1614
strategy:
1715
fail-fast: false
1816
matrix:
1917
sample:
20-
# clients
21-
- samples/client/petstore/scalaz
22-
- samples/client/petstore/scala-pekko
23-
- samples/client/petstore/scala-http4s
24-
- samples/client/petstore/scala-sttp4-jsoniter
25-
#- samples/client/petstore/scala-sttp
26-
#- samples/client/petstore/scala-sttp-circe
2718
# servers
2819
- samples/server/petstore/scala-play-server
2920
- samples/server/petstore/scala-akka-http-server

CI/circle_parallel.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,4 @@ else
116116
echo "Running node $NODE_INDEX ..."
117117
java -version
118118

119-
(cd samples/client/petstore/scala-akka && mvn integration-test)
120-
(cd samples/client/petstore/scala-sttp && mvn integration-test)
121-
(cd samples/client/petstore/scala-sttp-circe && mvn integration-test)
122-
(cd samples/client/petstore/scala-sttp4 && mvn integration-test)
123-
124119
fi

samples/client/petstore/scala-akka/.openapi-generator-ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@
2222
# Then explicitly reverse the ignore rule for a single file:
2323
#!docs/README.md
2424
pom.xml
25+
26+

samples/server/petstore/scala-cask/.openapi-generator-ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
#docs/*.md
2222
# Then explicitly reverse the ignore rule for a single file:
2323
#!docs/README.md
24+
#
25+
#
26+
#

0 commit comments

Comments
 (0)