Skip to content

Merge pull request #360 from AxonFramework/dependabot/github_actions/… #236

Merge pull request #360 from AxonFramework/dependabot/github_actions/…

Merge pull request #360 from AxonFramework/dependabot/github_actions/… #236

Workflow file for this run

name: Spring Cloud Extension
on:
push:
branches:
- main
- master
- axon-springcloud-*.*.x
jobs:
build:
name: Test and Build on JDK ${{ matrix.java-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- java-version: 8
sonar-enabled: false
deploy-enabled: true
- java-version: 11
sonar-enabled: false
deploy-enabled: false
- java-version: 17
sonar-enabled: true
deploy-enabled: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4.2.1
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
cache: 'maven'
server-id: sonatype
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Regular Build
if: ${{ !matrix.sonar-enabled }}
run: |
./mvnw -B -U -Dstyle.color=always clean verify
- name: Build with Coverage reports
if: matrix.sonar-enabled
run: |
./mvnw -B -U -Dstyle.color=always -Dcoverage clean verify
- name: Sonar Analysis
if: matrix.sonar-enabled
run: |
./mvnw -B -Dstyle.color=always sonar:sonar \
-Dsonar.projectKey=AxonFramework_extension-springcloud \
-Dsonar.organization=axonframework \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Sonatype
if: success() && matrix.deploy-enabled
run: |
./mvnw -B -U -Dstyle.color=always deploy -DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_ID }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASS }}
- name: Notify success to Slack
if: success()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1.6.0
with:
channel_id: CAGSEC92A
status: SUCCESS
color: good
- name: Notify failure to Slack
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1.6.0
with:
channel_id: CAGSEC92A
status: FAILED
color: danger