-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 3.19 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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: |
$jdkPath = 'C:\Program Files\BellSoft\LibericaJDK-17'
Invoke-WebRequest -Uri "https://download.bell-sw.com/java/17.0.6+10/bellsoft-jdk17.0.6+10-windows-amd64-full.zip" -OutFile "bellsoft-jdk-17-windows-amd64-full.zip"
Expand-Archive -Path "bellsoft-jdk-17-windows-amd64-full.zip" -DestinationPath $jdkPath
# Move extracted contents to the correct location
$extractedFolder = Get-ChildItem -Path $jdkPath -Directory | Select-Object -First 1
Get-ChildItem -Path (Join-Path -Path $extractedFolder.FullName -ChildPath "*") | Move-Item -Destination $jdkPath
Remove-Item -Recurse -Force $extractedFolder.FullName
# Update JAVA_HOME and PATH
echo "JAVA_HOME=$jdkPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "$jdkPath\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- 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-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: Run Qodana
uses: JetBrains/qodana-action@v5
with:
project-dir: .
results-dir: qodana-results