Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build project

on:
push:
pull_request:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [11, 17]
name: "Java ${{ matrix.java }} build"
steps:
- name: Checkout project
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Java
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
distribution: "temurin"
java-version: "${{ matrix.java }}"
cache: "maven"
- name: Verify build
run: mvn -B verify
sonar:
needs: build
if: github.base_ref == 'main' && github.event_name == 'pull_request'
name: Prepare analysis context
uses: WrenSecurity/.github/.github/workflows/sonar-pull-prepare.yml@main
with:
pull_request: ${{ toJSON(github.event.pull_request) }}
26 changes: 0 additions & 26 deletions .github/workflows/build.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/sonar-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Trigger Sonar analysis

on:
workflow_run:
workflows:
- Build project
types:
- completed

permissions:
contents: read

jobs:
prepare:
if: github.event.workflow_run.conclusion == 'success'
uses: WrenSecurity/.github/.github/workflows/sonar-prepare.yml@main
name: Prepare analysis context
with:
workflow_run: ${{ toJSON(github.event.workflow_run) }}
trigger:
needs: prepare
if: needs.prepare.outputs.sonar_allowed
name: Trigger Sonar analysis
uses: WrenSecurity/.github/.github/workflows/sonar-maven.yml@main
with:
java_version: 17
project_key: 'WrenSecurity_wrenicf-java-framework'
pull_request: ${{ needs.prepare.outputs.pull_request }}
secrets:
sonar_token: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wrensecurity</groupId>
<artifactId>wrensec-parent</artifactId>
<version>4.0.2</version>
<version>4.2.0</version>
</parent>

<groupId>org.wrensecurity.wrenicf</groupId>
Expand Down