This repository has been archived by the owner on Aug 11, 2023. It is now read-only.
forked from evansiroky/maven-semantic-release-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- enable semantic-release maven steps - enable lint ans test jobs in ci - add Upload coverage step to test job Closes: #81
- Loading branch information
Showing
2 changed files
with
66 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,53 +17,10 @@ permissions: | |
pull-requests: write | ||
|
||
jobs: | ||
# commit-lint: | ||
# if: ${{ github.event_name != 'pull_request' || !(github.head_ref == 'rc' && github.base_ref == 'master') }} | ||
# name: Lint Commit Messages | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: ⤵️ Check out code from GitHub | ||
# uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
# | ||
# - uses: wagoid/[email protected] | ||
# with: | ||
# configFile: .github/commitlint.config.js | ||
# helpURL: https://www.conventionalcommits.org | ||
|
||
# run-test: | ||
# needs: [ commit-lint ] | ||
# name: Run tests | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: ⤵️ Check out code from GitHub | ||
# uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
# | ||
# - name: init jvm | ||
# uses: actions/setup-java@v2 | ||
# with: | ||
# distribution: 'temurin' | ||
# java-version: '11' | ||
# cache: 'maven' | ||
# | ||
# - run: ./mvnw clean test | ||
# | ||
# - name: Publish Unit Test Results | ||
# uses: EnricoMi/publish-unit-test-result-action@v1 | ||
# if: always() | ||
# with: | ||
# files: "target/surefire-reports/TEST-*.xml" | ||
|
||
release: | ||
lint: | ||
if: ${{ !(github.event_name == 'pull_request' && contains('master rc', github.head_ref)) }} | ||
# needs: [ run-test ] | ||
name: Release | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new_release_published: ${{ steps.release.outputs.new_release_published }} | ||
steps: | ||
- name: Debug action | ||
uses: hmarr/[email protected] | ||
|
@@ -74,18 +31,71 @@ jobs: | |
GITHUB_CONTENT: "${{ toJson(github) }}" | ||
run: "echo 'Debug echo'" | ||
|
||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Lint Commit Messages | ||
uses: wagoid/[email protected] | ||
with: | ||
configFile: .github/commitlint.config.js | ||
helpURL: https://www.conventionalcommits.org | ||
|
||
test: | ||
needs: [ lint ] | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: init jvm | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
cache: 'maven' | ||
|
||
- name: Run tests | ||
run: ./mvnw clean package | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} Required for private repos | ||
files: target/site/jacoco/jacoco.xml | ||
env_vars: OS,JAVA_HOME | ||
verbose: true | ||
fail_ci_if_error: true | ||
|
||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
if: always() | ||
with: | ||
files: "target/surefire-reports/TEST-*.xml" | ||
|
||
release: | ||
needs: [ test ] | ||
name: Release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new_release_published: ${{ steps.release.outputs.new_release_published }} | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
# - name: init jvm | ||
# uses: actions/setup-java@v2 | ||
# with: | ||
# distribution: 'temurin' | ||
# java-version: '11' | ||
# cache: 'maven' | ||
- name: init jvm | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
cache: 'maven' | ||
|
||
- name: init npm | ||
uses: actions/setup-node@v3 | ||
|
This file contains 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