GeezerVison is showing github.com — chore: add codecov & sonar · ucloud/ucloud-sdk-java@8894592
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +14Lines changed: 14 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +--- |
| 2 | +name: Bug Report |
| 3 | +about: If something isn't working as expected |
| 4 | +--- |
| 5 | + |
| 6 | +### Version of UCloud SDK? |
| 7 | + |
| 8 | +### Version of Java (`java -version`)? |
| 9 | + |
| 10 | +### What issue did you see? |
| 11 | + |
| 12 | +### Steps to reproduce |
| 13 | + |
| 14 | +If you have have an runnable example, please include it. |
Collapse file
Copy file name to clipboard +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +<!--- Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests ---> |
| 2 | + |
| 3 | +FEATURES: |
| 4 | + |
| 5 | +ENHANCEMENTS: |
| 6 | + |
| 7 | +BUG FIXES: |
Collapse file
Copy file name to clipboard +21Lines changed: 21 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - release/* |
| 8 | + pull_request: |
| 9 | + types: [opened, synchronize, reopened] |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v2 |
| 16 | + - name: Run tests |
| 17 | + run: ./mvn test |
| 18 | + - name: Upload coverage to Codecov |
| 19 | + uses: codecov/codecov-action@v1 |
| 20 | + with: |
| 21 | + fail_ci_if_error: false |
Collapse file
Copy file name to clipboard +37Lines changed: 37 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +name: Sonar |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + - release/* |
| 7 | + pull_request: |
| 8 | + types: [opened, synchronize, reopened] |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Build |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + with: |
| 16 | + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis |
| 17 | + - name: Set up JDK 11 |
| 18 | + uses: actions/setup-java@v1 |
| 19 | + with: |
| 20 | + java-version: 11 |
| 21 | + - name: Cache SonarCloud packages |
| 22 | + uses: actions/cache@v1 |
| 23 | + with: |
| 24 | + path: ~/.sonar/cache |
| 25 | + key: ${{ runner.os }}-sonar |
| 26 | + restore-keys: ${{ runner.os }}-sonar |
| 27 | + - name: Cache Maven packages |
| 28 | + uses: actions/cache@v1 |
| 29 | + with: |
| 30 | + path: ~/.m2 |
| 31 | + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| 32 | + restore-keys: ${{ runner.os }}-m2 |
| 33 | + - name: Build and analyze |
| 34 | + env: |
| 35 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any |
| 36 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 37 | + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=ucloud_ucloud-sdk-java |
Collapse file
Copy file name to clipboardExpand all lines: .gitignore +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
14 | 14 | *.rar |
15 | 15 | *.jar |
16 | 16 |
|
17 | | -.*/ |
18 | 17 | .DS_Store |
| 18 | +.idea/ |
19 | 19 | *.iml |
20 | 20 | */target |
21 | 21 | target |
|
Collapse file
Copy file name to clipboard +11-7Lines changed: 11 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -# build:制品构建脚本 |
2 | | -# test-cov:单元测试覆盖率基线 |
3 | | -# fmt:格式化 |
4 | | - |
5 | 1 | JAVA_FILES=$$(find ./ -name "*.java") |
6 | 2 |
|
| 3 | +.PHONY: help |
| 4 | +help: |
| 5 | + @echo "build 制品构建脚" |
| 6 | + @echo "test-cov 单元测试覆盖率基线" |
| 7 | + @echo "fmt 格式化" |
| 8 | + |
| 9 | +.PHONY: build |
7 | 10 | build: |
8 | 11 | mvn clean package -DskipTests=true |
9 | 12 |
|
| 13 | +.PHONY: fmt |
10 | 14 | fmt: |
11 | 15 | java -jar ./cache/google-java-format-1.7-all-deps.jar --aosp -r ${JAVA_FILES} |
12 | 16 |
|
13 | | -lint: |
14 | | - @echo "" |
15 | | - |
| 17 | +.PHONY: test-cov |
16 | 18 | test-cov: |
17 | 19 | mvn test |
18 | 20 |
|
| 21 | +.PHONY: dev |
19 | 22 | dev: |
20 | 23 | mkdir -p cache |
21 | 24 | curl -sLo ./cache/google-java-format-1.7-all-deps.jar https://github.com/google/google-java-format/releases/download/google-java-format-1.7/google-java-format-1.7-all-deps.jar |
22 | 25 |
|
| 26 | +.PHONY: install |
23 | 27 | install: |
24 | 28 | mvn clean install -DskipTests=true |
Collapse file
Copy file name to clipboardExpand all lines: pom.xml +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
47 | 47 | <module>ucloud-sdk-java-uec</module> |
48 | 48 |
|
49 | 49 |
|
50 | | - <module>ucloud-sdk-java-ufile</module> |
51 | | - |
| 50 | + <module>ucloud-sdk-java- |
52 | 51 |
|
53 | 52 | <module>ucloud-sdk-java-umem</module> |
54 | 53 |
|
|