Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
feat: integrate codecov new-feature
Browse files Browse the repository at this point in the history
- enable semantic-release maven steps
- enable lint ans test jobs in ci
- add Upload coverage step to test job

Closes: #81
  • Loading branch information
xzima committed Apr 20, 2022
1 parent 475b43e commit cdcf750
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 56 deletions.
112 changes: 61 additions & 51 deletions .github/workflows/DEPLOY.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ plugins:
- "@semantic-release/release-notes-generator"
- "@semantic-release/changelog"
- - "@semantic-release/exec"
# - prepareCmd: |
# ./mvnw -B com.mycila:license-maven-plugin:4.1:format org.codehaus.mojo:license-maven-plugin:2.0.0:add-third-party
# publishCmd: |
# ./mvnw -B clean license:check package
- successCmd: |
- prepareCmd: |
./mvnw -B com.mycila:license-maven-plugin:4.1:format org.codehaus.mojo:license-maven-plugin:2.0.0:add-third-party
publishCmd: |
./mvnw -B clean license:check package
successCmd: |
echo "::set-output name=new_release_published::true"
echo "::set-output name=new_release_version::${nextRelease.version}"
echo "::set-output name=branch_type::${branch.type}"
Expand Down

0 comments on commit cdcf750

Please sign in to comment.