Skip to content

Commit

Permalink
[CI] Test with recent Java/NPM versions
Browse files Browse the repository at this point in the history
  • Loading branch information
v6ak committed Sep 22, 2023
1 parent 3830a7d commit cd592d8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,18 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: site
path: pack.zip
path: pack.zip

test-bleeding-edge-java-and-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build image
run: docker build . --target bleeding-edge
- name: build website
run: env DOCKER_TAG=bleeding-edge ./dockerenv-github.sh ./pack.sh
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: site
path: pack-for-verification.zip
20 changes: 16 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Adopted from mozilla/sbt

# This Dockerfile has one required ARG to determine which base image
# to use for the JDK to install.

# JDK 8 is the LTS with the longest support at the time of writing.
ARG OPENJDK_TAG=8

Expand All @@ -12,7 +9,7 @@ COPY project/build.properties /
RUN sed -n -e 's/^sbt\.version=//p' /build.properties > /version

# Second stage creates final image with the right SBT version
FROM amazoncorretto:${OPENJDK_TAG}
FROM amazoncorretto:${OPENJDK_TAG} AS conservative
RUN yum install -y rsync lftp zip unzip which
ARG NODE_VERSION=16
RUN yum install https://rpm.nodesource.com/pub_${NODE_VERSION}.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
Expand All @@ -25,3 +22,18 @@ RUN \
rm sbt-$(cat /sbt-version).rpm && \
mkdir /project
WORKDIR /project

# This stage can be used for testing whether the build is compatible with fresh versions of JDK and NodeJS/NPM
FROM fedora:latest AS bleeding-edge
RUN dnf install -y rsync lftp zip unzip which nodejs npm java-latest-openjdk-devel
COPY --from=sbt-version /version /sbt-version
RUN \
curl -L -o sbt-$(cat /sbt-version).rpm https://scala.jfrog.io/ui/api/v1/download\?repoKey=rpm\&path=%252Fsbt-$(cat /sbt-version).rpm && \
echo SBT launcher downloaded && \
rpm -i sbt-$(cat /sbt-version).rpm && \
rm sbt-$(cat /sbt-version).rpm && \
mkdir /project
WORKDIR /project


FROM conservative AS default
4 changes: 3 additions & 1 deletion dockerenv-github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -u
set -e
set -o pipefail

TAG=${DOCKER_TAG:-conservative}

exec docker run \
-v "$HOME"/.ivycache:/root/.ivy2 \
-v "$HOME"/.sbtcache:/root/.sbt \
Expand All @@ -12,5 +14,5 @@ exec docker run \
-v "$HOME"/.ssh/zbdb-id_rsa.pub:/root/.ssh/id_rsa.pub:ro \
-v "$(pwd)":/project \
-p 9000:9000 \
"$(docker build -q .)" \
"$(docker build -q . --target $TAG)" \
"$@"

0 comments on commit cd592d8

Please sign in to comment.