Skip to content

CAMEL-23271: Fix SonarCloud blocker reliability issues (resource leaks) #5

CAMEL-23271: Fix SonarCloud blocker reliability issues (resource leaks)

CAMEL-23271: Fix SonarCloud blocker reliability issues (resource leaks) #5

Workflow file for this run

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: SonarBuild
on:
pull_request:
branches:
- main
paths-ignore:
- README.md
- SECURITY.md
- Jenkinsfile
- Jenkinsfile.*
- NOTICE.txt
permissions:
contents: read
concurrency:
group: sonar-pr-${{ github.event.pull_request.head.repo.full_name }}-${{ github.event.pull_request.head.ref }}
cancel-in-progress: true
jobs:
build:
if: github.repository == 'apache/camel'
name: Build for Sonar Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: install-packages
uses: ./.github/actions/install-packages
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build with Maven
run: ./mvnw install -B -Dquickly
- name: Prepare compiled classes artifact
shell: bash
run: find . -name "target" -type d | tar -czf target.tar.gz -T -
- name: Upload compiled classes artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
id: target-upload
with:
name: sonar-target
path: target.tar.gz
if-no-files-found: error
retention-days: 1
- name: Prepare pull request metadata
shell: bash
run: |
echo "${{ github.event.pull_request.number }}" > pr-event.txt
echo "${{ github.event.pull_request.head.ref }}" >> pr-event.txt
echo "${{ github.event.pull_request.base.ref }}" >> pr-event.txt
echo "${{ github.event.pull_request.head.sha }}" >> pr-event.txt
echo "${{ steps.target-upload.outputs.artifact-id }}" >> pr-event.txt
- name: Upload pull request metadata
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: sonar-pr-event
path: pr-event.txt
if-no-files-found: error
retention-days: 1