feat: apply builder pattern for dynamic query build #45
Workflow file for this run
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
name: Run build, test and sonar checks | |
on: | |
pull_request: | |
branches: | |
- develop | |
push: | |
branches: | |
- feature/* | |
- develop | |
jobs: | |
build: | |
name: Gradle Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 21 | |
distribution: 'adopt' | |
- name: Run build with gradle | |
run: ./gradlew build -x test | |
continue-on-error: false | |
test: | |
name: Gradle Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 21 | |
distribution: 'adopt' | |
- name: Run tests with gradle | |
run: ./gradlew test | |
continue-on-error: true | |
sonarcloud-scan: | |
name: SonarCloud Scan | |
needs: [build, test] | |
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: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ./gradlew build jacocoTestReport sonar --info | |
continue-on-error: true | |
open_pull_request: | |
name: Open Pull Request | |
needs: [sonarcloud-scan] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Extract branch name | |
shell: bash | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV | |
- name: Create Pull Request | |
uses: repo-sync/pull-request@v2 | |
with: | |
source_branch: "${{ github.ref }}" | |
destination_branch: ${{ startsWith(github.ref, 'refs/heads/feature/') && 'develop' || 'main' }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
pr_title: "Automated PR from ${{ env.BRANCH_NAME }}" | |
pr_body: "New changes to ${{ env.BRANCH_NAME }}. Check the files changed and merge if everything is ok." | |
pr_label: 'automated-pr' |