Skip to content

Commit

Permalink
Merge branch 'develop' into magicDate
Browse files Browse the repository at this point in the history
  • Loading branch information
artbear authored Jun 4, 2024
2 parents eccb841 + b39efaf commit 9217e07
Show file tree
Hide file tree
Showing 957 changed files with 11,539 additions and 2,836 deletions.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"image":"mcr.microsoft.com/devcontainers/universal:2"}
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
groups:
freefair:
patterns:
- "io.freefair.*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
73 changes: 73 additions & 0 deletions .github/scripts/build-jpackage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import ntpath
import os
import platform
import re
import shutil
import sys


def build_image(base_dir, image_prefix, executable_file):
path_to_jar = get_bsl_ls_jar(base_dir)
if path_to_jar is None:
exit()

cmd_args = [
'jpackage',
'--name', 'bsl-language-server',
'--input', 'build/libs',
'--main-jar', path_to_jar]

if is_windows():
cmd_args.append('--win-console')

cmd_args.append('--type')
cmd_args.append('app-image')
cmd_args.append('--java-options')
cmd_args.append('-Xmx3g')

cmd = ' '.join(cmd_args)
os.system(cmd)

shutil.make_archive(
"bsl-language-server_" + image_prefix,
'zip',
'./',
executable_file)


def is_windows():
return platform.system() == 'Windows'


def get_base_dir():
if is_windows():
base_dir = os.getcwd() + "\\build\\libs"
else:
base_dir = os.getcwd() + "/build/libs"
return base_dir


def get_bsl_ls_jar(dir_name):
pattern = r"bsl.+\.jar"
names = os.listdir(dir_name)
for name in names:
fullname = os.path.join(dir_name, name)
if os.path.isfile(fullname) and re.search(pattern, fullname) and fullname.find('exec.jar') != -1:
return ntpath.basename(fullname)

return None


if __name__ == "__main__":
# directory with build project
arg_base_dir = get_base_dir()

# image prefix: `win`, `nic` or `mac`
arg_image_prefix = sys.argv[1]

# executable file: `bsl-language-server` or `bsl-language-server.app`
arg_executable_file = sys.argv[2]

build_image(base_dir=get_base_dir(),
image_prefix=sys.argv[1],
executable_file=sys.argv[2])
5 changes: 3 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ jobs:
uses: actions/checkout@v3

- name: Setup JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle

- name: Build with Gradle
run: ./gradlew bootJar

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.7"

Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/check-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Check making image

on:
push:
branches:
- develop
- feature/check-package


jobs:
build:
strategy:
fail-fast: true
matrix:
os: [windows-latest, ubuntu-latest, macOS-latest]
include:
- os: windows-latest
displayName: Windows
prefix: win
app-image: bsl-language-server
- os: ubuntu-latest
displayName: Linux
prefix: nix
app-image: bsl-language-server
- os: macOS-latest
displayName: MacOS
prefix: mac
app-image: bsl-language-server.app
runs-on: ${{ matrix.os }}
name: (${{ matrix.displayName }}) create image app version

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 20
distribution: 'temurin'
cache: gradle

- name: Build bootJar with Gradle
run: ./gradlew check build

- name: Build jpackage application image
run: python .github/scripts/build-jpackage.py ${{ matrix.prefix }} ${{ matrix.app-image }}




11 changes: 6 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
# Override language selection by uncommenting this and choosing your languages
with:
languages: java
Expand All @@ -52,4 +53,4 @@ jobs:
- run: ./gradlew jar

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
9 changes: 5 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@ jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle

- name: Build javadoc
run: ./gradlew --no-daemon javadoc

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.7.15'
architecture: 'x64'
Expand Down Expand Up @@ -145,7 +146,7 @@ jobs:
cp -R temp/site/. public/dev/en
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.9.2
uses: peaceiris/actions-gh-pages@v4.0.0
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: gh-pages
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: ['11', '17']
java_version: ['17', '20']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
cache: gradle
- name: Build with Gradle
run: ./gradlew check --stacktrace
- name: Archive test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: junit_report_${{ matrix.os }}_${{ matrix.java_version }}
path: build/reports/tests/test
5 changes: 3 additions & 2 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ jobs:
needs: gatekeeper
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Check javadoc build
run: ./gradlew javadoc --stacktrace
2 changes: 1 addition & 1 deletion .github/workflows/pre-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: echo ${{ github.event.number }} > PR_NUMBER.txt
- name: Archive PR number
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: PR_NUMBER
path: PR_NUMBER.txt
5 changes: 3 additions & 2 deletions .github/workflows/publish-to-sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Publish to Sonatype
run: ./gradlew publishMavenPublicationToSonatypeRepository -PsimplifyVersion
env:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: Download PR number artifact
if: github.event.workflow_run.event == 'pull_request'
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v3
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -34,7 +34,7 @@ jobs:
full_name: ${{ github.event.repository.full_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
Expand All @@ -48,19 +48,20 @@ jobs:
git checkout ${{ github.event.workflow_run.head_branch }}
git clean -ffdx && git reset --hard HEAD
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: SonarCloud Scan on PR
if: github.event.workflow_run.event == 'pull_request'
run: ./gradlew check sonarqube -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} -Dsonar.pullrequest.key=${{ fromJson(steps.get_pr_data.outputs.data).number }} -Dsonar.pullrequest.branch=${{ fromJson(steps.get_pr_data.outputs.data).head.ref }} -Dsonar.pullrequest.base=${{ fromJson(steps.get_pr_data.outputs.data).base.ref }}
run: ./gradlew check sonar -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} -Dsonar.pullrequest.key=${{ fromJson(steps.get_pr_data.outputs.data).number }} -Dsonar.pullrequest.branch=${{ fromJson(steps.get_pr_data.outputs.data).head.ref }} -Dsonar.pullrequest.base=${{ fromJson(steps.get_pr_data.outputs.data).base.ref }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: SonarCloud Scan on push
if: github.event.workflow_run.event == 'push' && github.event.workflow_run.head_repository.full_name == github.event.repository.full_name
run: ./gradlew check sonarqube -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} -Dsonar.branch.name=${{ github.event.workflow_run.head_branch }}
run: ./gradlew check sonar -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} -Dsonar.branch.name=${{ github.event.workflow_run.head_branch }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 7 additions & 5 deletions .github/workflows/qodana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,27 @@ on:
jobs:
gatekeeper:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && startsWith(github.head_ref, 'translations_') == false || github.event_name == 'push'
if: github.event_name == 'pull_request' && startsWith(github.head_ref, 'translations_') == false || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- run: echo 'Open the Golden Gate'

qodana:
needs: gatekeeper
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Qodana Scan'
uses: JetBrains/[email protected]
uses: JetBrains/[email protected]
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
with:
linter: jetbrains/qodana-jvm-community
- uses: github/codeql-action/upload-sarif@v2
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json
- name: Deploy to GitHub Pages
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3.9.2
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ runner.temp }}/qodana/results/report
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
Expand Down
Loading

0 comments on commit 9217e07

Please sign in to comment.