Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add smoke test and remove play json from the dependencies #74

Merged
merged 3 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ jobs:
distribution: 'adopt'
- name: Run tests
run: sbt test
- name: Smoke test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .github/workflows/smoke_test.sh
36 changes: 36 additions & 0 deletions .github/workflows/smoke_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
wjglerum marked this conversation as resolved.
Show resolved Hide resolved
set -euo pipefail

TRY_COUNT=30
sbt stage

cd target/universal/stage

APPLICATION_SECRET="9w/DBOjdTE?65hO5IzGu_XL5^AiK^>iUZgIF?mYVUbPNjNU[ver>zw[V@zlbb0wu" access_token=$GITHUB_TOKEN bin/lunatech-blog-engine &

PID=$!
trap "kill $! 2> /dev/null" EXIT

is_running() {
kill -0 $PID 2> /dev/null
}

is_responding() {
curl localhost:9000 -s -o /dev/null
}

for (( count=0; count < $TRY_COUNT; count++ )); do
if ! is_running; then
echo "::error::The application stopped before it could serve a page."
exit 1
fi

if is_responding; then
exit 0
fi

sleep 3
done

echo "::error::Timeout: the application did not serve a page in time."
exit 2
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ libraryDependencies ++= Seq(
"org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test,
"org.asciidoctor" % "asciidoctorj" % "2.5.10",
"com.47deg" %% "github4s" % "0.21.0",
"com.typesafe.play" %% "play-json" % "2.10.1",
)

Global / onChangedBuildSource := ReloadOnSourceChanges