Additional unit tests - ChangeStreams and ConfigManager #197
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Java CI with Maven | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
branches: | |
- main | |
env: | |
NEXUS_USERNAME: ${{ secrets.TOKEN_USERNAME }} | |
NEXUS_PASSWORD: ${{ secrets.TOKEN_PASSWORD }} | |
SIGNING_KEY_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }} | |
jobs: | |
calc_version: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Git Version | |
id: version | |
uses: codacy/[email protected] | |
with: | |
release-branch: main | |
- name: Show version | |
env: | |
version: ${{ steps.version.outputs.version }} | |
run: | | |
echo "Version:" | |
echo "${{ steps.version.outputs.version }}" | |
echo "### Version: $version" >> $GITHUB_STEP_SUMMARY | |
build: | |
runs-on: ubuntu-latest | |
needs: | |
- calc_version | |
env: | |
version: ${{ needs.calc_version.outputs.version }} | |
steps: | |
- name: Configure Signing Key | |
run: | | |
echo -n "$SIGNING_KEY" | base64 --decode | gpg --import --batch | |
env: | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY_BASE64 }} | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
server-username: NEXUS_USERNAME | |
server-password: NEXUS_PASSWORD | |
- name: Build with Maven | |
run: mvn -B package | |
- name: Run checks | |
run: mvn verify | |
- name: Archive jars | |
uses: actions/upload-artifact@v4 | |
with: | |
path: target/*.jar* | |
- name: Archive pmd | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pmd-report | |
path: target/site/pmd.html | |
- name: Archive code coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jacoco-coverage-report | |
path: target/site/jacoco/ | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- calc_version | |
env: | |
version: ${{ needs.calc_version.outputs.version }} | |
environment: Deployment_manual | |
steps: | |
- name: Configure Signing Key | |
run: | | |
echo -n "$SIGNING_KEY" | base64 --decode | gpg --import --batch | |
env: | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY_BASE64 }} | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
server-id: ossrh | |
cache: maven | |
server-username: NEXUS_USERNAME | |
server-password: NEXUS_PASSWORD | |
- name: Deploy to SonaType | |
run: mvn deploy | |
post_deploy_tagging: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: | |
- calc_version | |
- deploy | |
permissions: | |
contents: write | |
steps: | |
- name: Create tag | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/${{ needs.calc_version.outputs.version }}', | |
sha: context.sha | |
}) |