Skip to content

Build with Java 17 #7313

Build with Java 17

Build with Java 17 #7313

Workflow file for this run

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build with Java 17
on:
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
push:
branches: [ main ]
paths-ignore:
- '**/README.md'
- '**/HISTORY.md'
- 'docs/**'
pull_request:
branches: [ main ]
merge_group:
branches: [ main ]
schedule:
- cron: '0 9 * * *'
env:
CHROME_VERSION: 145.0.7632.117
permissions: # added using https://github.com/step-security/secure-repo
contents: read
packages: write
jobs:
frontend-tests:
runs-on: ubuntu-24.04
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.3
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run frontend tests
run: pnpm -r test
build:
runs-on: ubuntu-24.04
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
env:
DISPLAY: :0
SE_BROWSER_PATH: /usr/bin/google-chrome
webdriver.chrome.driver: /usr/bin/chromedriver
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.3
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: 17
cache: gradle
- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: Setup Chrome and Chromedriver (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get remove google-chrome-stable chromium -y
sudo rm -rf /usr/bin/chromedriver
sudo rm -rf /usr/bin/google-chrome
echo "Executing: npx @puppeteer/browsers install chrome@$CHROME_VERSION"
npx @puppeteer/browsers install chrome@$CHROME_VERSION
echo "Executing: npx @puppeteer/browsers install chromedriver@$CHROME_VERSION"
npx @puppeteer/browsers install chromedriver@$CHROME_VERSION
echo "Executing: sudo ln -s /home/runner/work/jlineup/jlineup/chromedriver/linux-$CHROME_VERSION/chromedriver-linux64/chromedriver /usr/bin/chromedriver"
sudo ln -s /home/runner/work/jlineup/jlineup/chromedriver/linux-$CHROME_VERSION/chromedriver-linux64/chromedriver /usr/bin/chromedriver
echo "Executing: sudo ln -s /home/runner/work/jlineup/jlineup/chrome/linux-$CHROME_VERSION/chrome-linux64/chrome /usr/bin/google-chrome"
sudo ln -s /home/runner/work/jlineup/jlineup/chrome/linux-$CHROME_VERSION/chrome-linux64/chrome /usr/bin/google-chrome
echo "Executing: /usr/bin/google-chrome --version"
/usr/bin/google-chrome --version
echo "SE_BROWSER_PATH: '$SE_BROWSER_PATH'"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Dependency check and build with gradle
if: ${{ github.event_name == 'schedule' }}
env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
run: |
if [ -z "$NVD_API_KEY" ]; then echo "NVD API KEY is NULL"; else echo "NVD API key is not NULL"; fi
./gradlew -DNVD_API_KEY="$NVD_API_KEY" build
- name: Archive dependency check report
if: ${{ github.event_name == 'REMOVE_ME_WHEN_DEPENDENCY_CHECK_WORKS_AGAINschedule' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dependency-check-report
path: build/reports/dependency-check-report.html
- name: Build with gradle
if: ${{ github.event_name != 'schedule' }}
run: |
./gradlew build
- name: Publish snapshot to GitHub Packages
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.JRELEASER_MAVENCENTRAL_PASSWORD }}
run: |
./gradlew publish jreleaserDeploy