Skip to content

[JN-1476] Allow hyphens in page path #3270

[JN-1476] Allow hyphens in page path

[JN-1476] Allow hyphens in page path #3270

Workflow file for this run

name: Sonar
on:
workflow_dispatch:
push:
branches:
- development
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonar-java:
name: SonarCloud Java
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'adopt'
- name: Scan via gradle
run: >-
./gradlew
--build-cache
-x test
-x spotlessJava
-x spotlessJavaApply
-x spotlessJavaCheck
-x spotlessCheck
-x spotlessApply
build sonar -info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Notify slack on failure
uses: broadinstitute/[email protected]
if: failure() && github.ref == 'refs/heads/development'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
channel: '#juniper-dev-notifications'
status: failure
author_name: SonarCloud Java scan failed on merge to development
fields: job
text: "SonarCloud Java scan failed :sadpanda:"
username: 'Juniper Build Notifications'
sonar-typescript:
name: SonarCloud TypeScript
runs-on: ubuntu-latest
strategy:
matrix:
subproject: ['ui-admin', 'ui-core', 'ui-participant']
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v8
- name: Set SonarCloud parameters
id: set-sonar-params
run: |
if [[ "${{ steps.branch-name.outputs.current_branch }}" != "development" ]]; then
echo "SONAR_ARGS=-Dsonar.branch.target=${{ github.event.repository.default_branch }} -Dsonar.branch.name=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV
fi
- name: Scan ${{ matrix.subproject }} via sonarcloud-github-action
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: ${{ github.workspace }}/${{ matrix.subproject }}
args: >
${{ env.SONAR_ARGS }}
- name: Notify slack on failure
uses: broadinstitute/[email protected]
if: failure() && github.ref == 'refs/heads/development'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
channel: '#juniper-dev-notifications'
status: failure
author_name: SonarCloud TypeScript scan failed on merge to development
fields: job
text: "SonarCloud TypeScript scan failed :sadpanda:"
username: 'Juniper Build Notifications'