Commit 18bcc6a2 authored by Romain Bioteau's avatar Romain Bioteau
Browse files

chore(actions): add pr build action



Signed-off-by: default avatarRomain Bioteau <romain.bioteau@bonitasoft.com>
parent 0f7027df
...@@ -15,6 +15,6 @@ updates: ...@@ -15,6 +15,6 @@ updates:
# Maintain dependencies for maven # Maintain dependencies for maven
- package-ecosystem: "maven" - package-ecosystem: "maven"
directory: "/" directory: "/"
target-branch: dev target-branch: master
schedule: schedule:
interval: "daily" interval: "daily"
name: build-pr
on:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
cache: 'maven'
- name: Build with Sonarcloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: ${{ env.SONAR_TOKEN != '' }}
run: ./mvnw -B -ntp clean verify sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }}
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: ${{ env.SONAR_TOKEN == '' }}
run: ./mvnw -B -ntp clean verify
- run: mkdir staging && cp target/*.zip staging
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: Connectors
path: staging
...@@ -3,17 +3,13 @@ name: Build ...@@ -3,17 +3,13 @@ name: Build
on: on:
push: push:
branches: [ master ] branches: [ master ]
pull_request:
branches: [ master ]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v2 uses: actions/setup-java@v2
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment