[chore]create deploy pipeline #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - master | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| checks: write | |
| env: | |
| MAVEN_OPTS: -Xmx2g | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '11' | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: Run tests | |
| run: | | |
| mvn test \ | |
| --batch-mode \ | |
| --fail-at-end | |
| - name: Report test results | |
| uses: dorny/test-reporter@v2 | |
| if: always() | |
| with: | |
| name: Maven Tests | |
| path: '**/target/surefire-reports/*.xml' | |
| reporter: java-junit | |
| fail-on-error: 'false' | |
| - name: Build project | |
| run: | | |
| mvn package \ | |
| --batch-mode \ | |
| -DskipTests=true |