add Liberica to path and set JAVA_HOME #202
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up BellSoft Liberica Full JDK on Ubuntu | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget | |
wget https://download.bell-sw.com/java/17.0.6+10/bellsoft-jdk17.0.6+10-linux-amd64-full.deb | |
sudo apt-get install -y ./bellsoft-jdk17.0.6+10-linux-amd64-full.deb | |
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/bellsoft-java17-full-amd64/bin/java 1 | |
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/bellsoft-java17-full-amd64/bin/javac 1 | |
echo "JAVA_HOME=/usr/lib/jvm/bellsoft-java17-full-amd64" >> $GITHUB_ENV | |
echo "/usr/lib/jvm/bellsoft-java17-full-amd64/bin" >> $GITHUB_PATH | |
- name: Set up BellSoft Liberica Full JDK on Windows | |
if: runner.os == 'Windows' | |
run: | | |
curl -L -o bellsoft-jdk-17-windows-amd64-full.zip https://download.bell-sw.com/java/17.0.6+10/bellsoft-jdk17.0.6+10-windows-amd64-full.zip | |
Expand-Archive -Path bellsoft-jdk-17-windows-amd64-full.zip -DestinationPath $env:ProgramFiles\BellSoft | |
echo "JAVA_HOME=$env:ProgramFiles\BellSoft\jdk-17" >> $Env:GITHUB_ENV | |
echo "$env:ProgramFiles\BellSoft\jdk-17\bin" >> $Env:GITHUB_PATH | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Execute Gradle build | |
run: ./gradlew build | |
id: compile | |
continue-on-error: false | |
qodana: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up BellSoft Liberica Full JDK | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget | |
wget https://download.bell-sw.com/java/17.0.6+10/bellsoft-jdk17.0.6+10-linux-aarch64-full.deb | |
sudo apt-get install -y ./bellsoft-jdk17.0.6+10-linux-aarch64-full.deb | |
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/bellsoft-java17-full-aarch64/bin/java 1 | |
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/bellsoft-java17-full-aarch64/bin/javac 1 | |
echo "JAVA_HOME=/usr/lib/jvm/bellsoft-java17-full-aarch64" >> $GITHUB_ENV | |
echo "/usr/lib/jvm/bellsoft-java17-full-aarch64/bin" >> $GITHUB_PATH | |
- name: Qodana Scan | |
id: qodana | |
uses: JetBrains/[email protected] | |
env: | |
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} | |
continue-on-error: false |