Skip to content

Commit a11397e

Browse files
authored
Add sonar & todos check & dependency check. (#37)
* Add sonar & todos check & dependency check. * Add licenses and exclude go.mod & go.sum submodule * Modify version from 1.3.2-SNAPSHOT to 1.3.2
1 parent 55c7de7 commit a11397e

File tree

81 files changed

+1231
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1231
-36
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This workflow will check if dependencies have changed (adding new dependencies or removing existing ones)
2+
3+
name: Dependency Check
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
- "new_*"
10+
paths-ignore:
11+
- 'docs/**'
12+
- 'site/**'
13+
pull_request:
14+
branches:
15+
- master
16+
- "new_*"
17+
paths-ignore:
18+
- 'docs/**'
19+
- 'site/**'
20+
# allow manually run the action:
21+
workflow_dispatch:
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
26+
27+
env:
28+
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
29+
MAVEN_ARGS: --batch-mode --no-transfer-progress
30+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
31+
32+
jobs:
33+
dependency-check:
34+
strategy:
35+
fail-fast: false
36+
max-parallel: 15
37+
matrix:
38+
java: [ 17 ]
39+
os: [ ubuntu-latest ]
40+
runs-on: ${{ matrix.os }}
41+
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v4
45+
46+
- name: Set up JDK ${{ matrix.java }}
47+
uses: actions/setup-java@v4
48+
with:
49+
distribution: corretto
50+
java-version: ${{ matrix.java }}
51+
52+
- name: Cache Maven packages
53+
uses: actions/cache@v4
54+
with:
55+
path: ~/.m2
56+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
57+
restore-keys: ${{ runner.os }}-m2-
58+
59+
- name: Do the dependency check
60+
shell: bash
61+
run: mvn verify -Dmaven.test.skip=true -Dmdep.analyze.skip=true -P enable-sbom-check

.github/workflows/grafana-plugin.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
build:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v4
25+
- name: Checkout code
26+
uses: actions/checkout@v4
2627

2728
- name: Setup Node.js environment
2829
uses: actions/setup-node@v4

.github/workflows/sonar.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Sonar
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
- "new_*"
11+
paths-ignore:
12+
- "docs/**"
13+
- 'site/**'
14+
pull_request:
15+
branches:
16+
- master
17+
- "new_*"
18+
paths-ignore:
19+
- "docs/**"
20+
- 'site/**'
21+
# allow manually run the action:
22+
workflow_dispatch:
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: true
27+
28+
env:
29+
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
30+
MAVEN_ARGS: --batch-mode --no-transfer-progress
31+
PR_NUMBER: ${{ github.event.number }}
32+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
33+
34+
jobs:
35+
sonar:
36+
runs-on: ubuntu-latest
37+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'apache/iotdb-extras' || github.event_name == 'push'
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
42+
- name: Set up JDK 17
43+
uses: actions/setup-java@v4
44+
with:
45+
distribution: corretto
46+
java-version: 17
47+
48+
- name: Cache Maven packages
49+
uses: actions/cache@v4
50+
with:
51+
path: ~/.m2
52+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
53+
restore-keys: ${{ runner.os }}-m2-
54+
55+
- name: SonarCloud Report
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
59+
run: |
60+
mvn -B -P verify sonar:sonar \
61+
-Dsonar.organization=apache \
62+
-Dsonar.projectKey=apache_iotdb_extras \
63+
-Dsonar.host.url=https://sonarcloud.io \
64+
-Dsonar.token=${{ secrets.SONARCLOUD_TOKEN }} \
65+
-DskipTests -pl '!distribution' -am

.github/workflows/todos-check.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Check TODOs and FIXMEs in Changed Files
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- "new_*"
8+
paths-ignore:
9+
- 'docs/**'
10+
- 'site/**'
11+
# allow manually run the action:
12+
workflow_dispatch:
13+
14+
jobs:
15+
todo-check:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Check for TODOs and FIXMEs in changed files
23+
run: |
24+
# Fetch the target branch
25+
git fetch origin $GITHUB_BASE_REF
26+
27+
git switch -c check_branch
28+
29+
# Get the diff of the changes
30+
DIFF=$(git diff origin/$GITHUB_BASE_REF check_branch)
31+
32+
33+
# Check the diff for TODOs
34+
if echo "$DIFF" | grep -Eq '^\+.*(TODO|FIXME)'; then
35+
echo "TODO or FIXME found in the changes. Please resolve it before merging."
36+
# exit 1
37+
else
38+
echo "No TODOs found in changed content."
39+
fi

connectors/flink-iotdb-connector/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>org.apache.iotdb</groupId>
2222
<artifactId>connectors</artifactId>
23-
<version>1.3.2-SNAPSHOT</version>
23+
<version>1.3.2</version>
2424
</parent>
2525
<artifactId>flink-iotdb-connector</artifactId>
2626
<name>IoTDB: Connector: Apache Flink</name>

connectors/flink-sql-iotdb-connector/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.iotdb</groupId>
2626
<artifactId>connectors</artifactId>
27-
<version>1.3.2-SNAPSHOT</version>
27+
<version>1.3.2</version>
2828
</parent>
2929
<artifactId>flink-sql-iotdb-connector</artifactId>
3030
<name>IoTDB: Connector: Apache Flink SQL</name>

connectors/flink-tsfile-connector/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.iotdb</groupId>
2626
<artifactId>connectors</artifactId>
27-
<version>1.3.2-SNAPSHOT</version>
27+
<version>1.3.2</version>
2828
</parent>
2929
<artifactId>flink-tsfile-connector</artifactId>
3030
<name>IoTDB: Connector: Apache Flink TSFile</name>

connectors/grafana-connector/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.iotdb</groupId>
2626
<artifactId>connectors</artifactId>
27-
<version>1.3.2-SNAPSHOT</version>
27+
<version>1.3.2</version>
2828
</parent>
2929
<artifactId>iotdb-grafana-connector</artifactId>
3030
<packaging>war</packaging>

connectors/grafana-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>org.apache.iotdb</groupId>
2222
<artifactId>connectors</artifactId>
23-
<version>1.3.2-SNAPSHOT</version>
23+
<version>1.3.2</version>
2424
</parent>
2525
<artifactId>iotdb-grafana-plugin</artifactId>
2626
<packaging>pom</packaging>

connectors/hadoop/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.iotdb</groupId>
2626
<artifactId>connectors</artifactId>
27-
<version>1.3.2-SNAPSHOT</version>
27+
<version>1.3.2</version>
2828
</parent>
2929
<artifactId>hadoop-tsfile</artifactId>
3030
<name>IoTDB: Connector: Apache Hadoop TSFile</name>

0 commit comments

Comments
 (0)