-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (40 loc) · 1.16 KB
/
check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Check Branch
on:
push:
branches:
- feature/**
- bugfix/**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Get current branch name
id: get_branch
run: echo "CURRENT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.1.0
- name: Build
run: CI=true gradle clean assemble
- name: Test
run: CI=true gradle test
- name: Integration Test
run: CI=true gradle integrationTest
- name: Sonar Scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
BRANCH_NAME: ${{ env.CURRENT_BRANCH_NAME }}
run: |
echo "Branch name $BRANCH_NAME"
CI=true gradle sonar --info -Dsonar.branch.name=$BRANCH_NAME