-
Notifications
You must be signed in to change notification settings - Fork 17
46 lines (42 loc) · 1.71 KB
/
gradle.yml
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
41
42
43
44
45
46
name: Java CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.11
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Log into registry
if: ${{ !contains(github.ref, 'dependabot') }}
run: echo "${{ secrets.SALESFORCE_DOCKER_HUB_SECRET }}" | docker login --username sholavanalli508 --password-stdin
- name: Build with Gradle
run: ./gradlew build --info --stacktrace
- name: Publish Failure Test Report
if: ${{ failure() }} # doesn't run unless it specifically grabs the failure condition of the previous step..
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Extract project version
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: echo "::set-env name=GRADLE_PROJECT_VERSION::`./gradlew properties|grep version |cut -c 10-`"
- name: Show project version
run: echo "$GRADLE_PROJECT_VERSION"
- name: Publish Docker container
if: ${{ !contains(github.ref, 'dependabot') }}
# run: ./gradlew -PdockerRepo=docker.pkg.github.com/${{ github.repository }}/ -x test publish --info
run: ./gradlew -PdockerRepo=salesforce/ -x test publish --info
# - name: scan docker image
# if: ${{ !contains(github.ref, 'dependabot') }}
# uses: azure/container-scan@v0
# with:
# image-name: salesforce/carbonj:${{ env.GRADLE_PROJECT_VERSION }}
# severity-threshold: CRITICAL
# run-quality-checks: false