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

Build & run on JDK 21 #25

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
43 changes: 24 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@ jobs:
name: front-static
path: frontend/dist/out

back-missinglink-check:
runs-on: ubuntu-latest

env:
SBT_OPTS: "-Xms6g -Xmx6g -XX:+AlwaysPreTouch -XX:ReservedCodeCacheSize=128M -XX:MaxMetaspaceSize=512M -Xss2m -XX:+TieredCompilation -XX:+UseParallelGC"

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
check-latest: true

- name: Compile and test
run: |
cd backend
sbt "project mockingbird-api;clean;missinglinkCheck;"

back-build:
needs: [front-build]

Expand All @@ -77,7 +97,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 21
check-latest: true

- name: Install Protoc
Expand All @@ -95,7 +115,7 @@ jobs:
- name: Compile and test
run: |
cd backend
sbt "project mockingbird-api;clean;fixCheck;test;missinglinkCheck;Docker / stage;"
sbt "project mockingbird-api;clean;fixCheck;test;Docker / stage;"

- name: Build docker image for test
uses: docker/build-push-action@v3
Expand All @@ -105,12 +125,6 @@ jobs:
tags: ${{ env.MOCKINGBIRD_TEST_IMAGE_JVM }}
if: ${{ ! ( github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') ) }}

- name: ZIP stages files
uses: montudor/action-zip@v1
with:
args: zip -r layers.zip ./backend/mockingbird-api/target/docker/stage
if: ${{ github.ref_type == 'tag' }}

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
Expand All @@ -127,15 +141,6 @@ jobs:
tags: ghcr.io/leviysoft/mockingbird:${{ steps.get-ref.outputs.tag }}
if: ${{ github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') }}

- name: Publish layers
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: layers.zip
asset_name: layers.zip
tag: ${{ github.ref_name }}
if: ${{ github.ref_type == 'tag' }}

- name: Save docker image to file
run: |
docker save -o /tmp/image-jvm.tar ${{ env.MOCKINGBIRD_TEST_IMAGE_JVM }}
Expand All @@ -152,7 +157,7 @@ jobs:
back-build-native:
needs: [front-build]

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

env:
CI: true
Expand All @@ -171,7 +176,7 @@ jobs:

- uses: graalvm/setup-graalvm@v1
with:
java-version: '17'
java-version: '21'
distribution: 'graalvm'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions backend/project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ object Settings {
},
dockerExposedPorts := ports,
dockerRepository := ciDockerRegistry.map(_ + "/tcb"),
dockerBaseImage := "eclipse-temurin:17-jre-focal",
dockerBaseImage := "eclipse-temurin:21-jre-jammy",
dockerCommands := dockerCommands.value.patch(
8,
Seq(
Expand All @@ -153,7 +153,7 @@ object Settings {
ports: List[Int],
user: String = "mockingbird",
userId: Option[String] = Some("2048"),
imageName: String = "ubuntu:20.04"
imageName: String = "ubuntu:22.04"
): Project => Project = { prj: Project =>
import com.typesafe.sbt.packager.docker.DockerChmodType
import com.typesafe.sbt.packager.docker.{Cmd, DockerPermissionStrategy}
Expand Down
Loading