Skip to content

Commit 76a0135

Browse files
authored
Update main.yml
1 parent 2576aa8 commit 76a0135

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

.github/workflows/main.yml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
1-
- name: DeepSource Test Coverage Action
2-
# You may pin to the exact commit or the version.
3-
# uses: DeepSourceCorp/test-coverage-action@e02a039827236fa21a95866e7cd0b1c52ca61e76
4-
uses: DeepSourceCorp/test-coverage-action@v1.1.2
5-
with:
6-
# Programming language shortcode for which coverage is reported. Allowed values are — python, go, javascript, ruby, java, kotlin, scala, php, csharp, cxx, rust, swift
7-
key:
8-
# Path to the coverage data file. e.g. ./coverage.xml
9-
coverage-file:
10-
# DeepSource DSN of this repository. It is available under Settings → Reporting tab of the repository page on DeepSource.
11-
dsn:
12-
# Should the CI build fail if there is an error while uploading the report to DeepSource? Allowed values are — true, false
13-
fail-ci-on-error: # optional
14-
# HEAD commit for which the Test Coverage report is being sent
15-
commit-sha: # optional, default is ${{ github.event.pull_request.head.sha }}
16-
1+
name: Java CI with Maven
2+
3+
on:
4+
push:
5+
branches: [ "main" ] # 触发分支
6+
pull_request:
7+
branches: [ "main" ] # 触发分支
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: '11'
20+
distribution: 'temurin' # 选择一个Java发行版
21+
cache: maven # 缓存m2仓库以加速构建
22+
- name: Build with Maven
23+
run: mvn -B clean package --file pom.xml
24+
- name: Run JUnit tests
25+
run: mvn -B verify --file pom.xml
26+
- name: Archive test results
27+
if: always()
28+
uses: actions/upload-artifact@v3
29+
with:
30+
name: test-results
31+
path: target/surefire-reports/

0 commit comments

Comments
 (0)