Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
max_line_length = 120
ij_wrap_on_typing = true
ij_visual_guides = 120


[*.{java,xml,py}]
indent_style = space
indent_size = 4

[*.go]
indent_style = tab

[*.{java,xml}]
# Ignore the IDEA unsupported warning & it works well (indeed)
continuation_indent_size = 8

[*.md]
max_line_length = off
ij_wrap_on_typing = false
ij_visual_guides = 160

[*.java]
ij_java_doc_add_p_tag_on_empty_lines = true
ij_java_doc_do_not_wrap_if_one_line = true
ij_java_annotation_parameter_wrap = normal
ij_java_align_multiline_annotation_parameters = true
ij_java_class_count_to_use_import_on_demand = 100
ij_java_names_count_to_use_import_on_demand = 100
ij_java_imports_layout = $*, |, java.**, |, javax.**, |, org.**, |, com.**, |, *

ij_java_line_comment_at_first_column = false
ij_java_align_multiline_chained_methods = true
ij_java_align_multiline_parameters_in_calls = true
ij_java_align_multiline_binary_operation = true
ij_java_align_multiline_assignment = true
ij_java_align_multiline_ternary_operation = true
ij_java_align_multiline_throws_list = true
ij_java_align_multiline_extends_list = true
ij_java_align_multiline_array_initializer_expression = true

ij_java_call_parameters_wrap = normal
ij_java_method_parameters_wrap = normal
ij_java_resource_list_wrap = normal
ij_java_extends_list_wrap = normal
ij_java_throws_list_wrap = normal
ij_java_method_call_chain_wrap = normal
ij_java_binary_operation_wrap = normal
ij_java_ternary_operation_wrap = normal
ij_java_for_statement_wrap = normal
ij_java_array_initializer_wrap = normal
ij_java_assignment_wrap = normal
ij_java_assert_statement_wrap = normal
ij_java_if_brace_force = if_multiline
ij_java_do_while_brace_force = always
ij_java_while_brace_force = if_multiline
ij_java_for_brace_force = if_multiline
ij_java_wrap_long_lines = true
ij_java_parameter_annotation_wrap = normal
ij_java_enum_constants_wrap = split_into_lines

ij_java_keep_blank_lines_in_declarations = 1
ij_java_keep_blank_lines_in_code = 1
ij_java_keep_blank_lines_between_package_declaration_and_header = 1
ij_java_keep_blank_lines_before_right_brace = 1
ij_java_blank_lines_around_class = 1
ij_java_blank_lines_after_class_header = 1

ij_smart_tabs = true

[*.xml]
max_line_length = 120
ij_visual_guides = 120
ij_xml_text_wrap = off
ij_xml_space_inside_empty_tag = true

[*.{yaml,yml}]
indent_style = space
indent_size = 2
ij_yaml_spaces_within_braces = false
ij_yaml_spaces_within_brackets = false

[*.properties]
ij_properties_keep_blank_lines = true
60 changes: 0 additions & 60 deletions .github/configs/settings.xml

This file was deleted.

10 changes: 1 addition & 9 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ defaults:

jobs:
analyze:
env:
USE_STAGE: 'true' # Whether to include the stage repository.
name: Analyze
runs-on: ubuntu-latest
permissions:
Expand All @@ -38,13 +36,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'

- name: use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf ../.github/configs/settings.xml $HOME/.m2/settings.xml
java-version: '17'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
95 changes: 49 additions & 46 deletions .github/workflows/computer-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,54 @@ on:
push:
branches:
- master
- /^release-.*$/
- release-*
paths:
- computer/**
- .github/workflows/computer-ci.yml
pull_request:
paths:
- computer/**
- .github/workflows/computer-ci.yml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: computer

jobs:
computer-ci:
name: computer-ci (server ${{ matrix.server }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
server: ['1.7.0', 'latest']
env:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: computer-dist/src/assembly/travis
BSP_ETCD_URL: http://localhost:2579
KUBERNETES_VERSION: 1.20.1
GRAPH_ENV_VERSION: 1.7.0
GRAPH_ENV_VERSION: ${{ matrix.server }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

# TODO: Upgrade to Java11 supported version
- name: Install JDK 8 for HDFS
- name: Install JDK 17
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '17'
distribution: 'zulu'

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk17-m2-${{ hashFiles('computer/**/pom.xml') }}
restore-keys: ${{ runner.os }}-jdk17-m2-

- name: License check(RAT)
run: |
pwd
Expand All @@ -49,65 +64,53 @@ jobs:
with:
python-version: '3.8'

- name: Cache HDFS packages
uses: actions/cache@v4
id: hdfs-cache
with:
path: ~/hadoop-3.3.2.tar.gz
key: ${{ runner.os }}--hadoop
restore-keys: ${{ runner.os }}-hadoop

- name: Download HDFS
if: steps.hdfs-cache.outputs.cache-hit != 'true'
run: wget https://archive.apache.org/dist/hadoop/common/hadoop-3.3.2/hadoop-3.3.2.tar.gz -O ~/hadoop-3.3.2.tar.gz

- name: Setup HDFS
run: $TRAVIS_DIR/install-hdfs.sh
run: '"$TRAVIS_DIR/install-hdfs.sh"'

- name: Setup Minikube-Kubernetes
run: $TRAVIS_DIR/install-k8s.sh

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
run: '"$TRAVIS_DIR/install-k8s.sh"'

- name: Check Component
run: |
curl localhost:9000
docker exec hugegraph-ci-hdfs-namenode hdfs dfs -ls /dataset
kubectl get nodes

- name: Prepare env and service
run: |
$TRAVIS_DIR/install-env.sh
$TRAVIS_DIR/load-data-into-hugegraph.sh ${{ env.GRAPH_ENV_VERSION }}

- name: Install JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'zulu'

- name: Use staged maven repo
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf ../.github/configs/settings.xml $HOME/.m2/settings.xml
"$TRAVIS_DIR/install-env.sh"
"$TRAVIS_DIR/load-data-into-hugegraph.sh" "$GRAPH_ENV_VERSION"
docker inspect --format '{{.Config.Image}} {{.Image}}' graph
curl -fsS --max-time 10 http://localhost:8080/versions | tee /tmp/hugegraph-ci-versions.json
jq -e --arg tag "$GRAPH_ENV_VERSION" '
.versions.core | select(type == "string" and length > 0 and ($tag == "latest" or . == $tag))
' /tmp/hugegraph-ci-versions.json

- name: Compile
run: mvn clean compile -e -Dmaven.javadoc.skip=true -ntp

- name: Integrate test
run: mvn test -P integrate-test -ntp
timeout-minutes: 10
run: |
(
sleep 180
jps -l | while read -r pid main; do
case "$main" in
*surefirebooter*|org.apache.maven.surefire.booter.ForkedBooter)
jcmd "$pid" Thread.print -l
;;
esac
done
) &
diagnostics_pid=$!
trap 'kill "$diagnostics_pid" 2>/dev/null || true' EXIT
mvn test -P integrate-test -ntp

- name: Unit test
timeout-minutes: 15
run: mvn test -P unit-test -ntp

- name: Upload coverage to Codecov
# TODO: Upgrade to v5 later
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: target/site/jacoco/jacoco.xml
files: computer/target/site/jacoco/jacoco.xml
24 changes: 9 additions & 15 deletions .github/workflows/license-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
- /^release-.*$/
- release-*
pull_request:

defaults:
Expand All @@ -29,9 +29,9 @@ jobs:
log: info
config: .licenserc.yaml

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

- name: License check(RAT)
Expand All @@ -44,24 +44,18 @@ jobs:
runs-on: ubuntu-latest
env:
SCRIPT_DEPENDENCY: computer-dist/scripts/dependency
USE_STAGE: 'true' # Whether to include the stage repository.
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf ../.github/configs/settings.xml $HOME/.m2/settings.xml
- name: Compile install
run: mvn install -DskipTests=true -ntp
- name: Generate & check current 3rd-party dependencies
run: |
bash $SCRIPT_DEPENDENCY/regenerate_known_dependencies.sh current-dependencies.txt
cat $SCRIPT_DEPENDENCY/current-dependencies.txt
bash $SCRIPT_DEPENDENCY/check_dependencies.sh
bash "$SCRIPT_DEPENDENCY/regenerate_known_dependencies.sh" current-dependencies.txt
cat "$SCRIPT_DEPENDENCY/current-dependencies.txt"
bash "$SCRIPT_DEPENDENCY/check_dependencies.sh"
Loading
Loading