generated from ministryofjustice/hmpps-template-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(*): fix failing builds by using secrets
- Loading branch information
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Build and test kotlin | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
java_version: | ||
type: string | ||
required: false | ||
default: '21' | ||
java_options: | ||
type: string | ||
default: '-Xmx512m -XX:ParallelGCThreads=2 -XX:ConcGCThreads=2 -Djava.util.concurrent.ForkJoinPool.common.parallelism=2 -Dorg.gradle.daemon=false -Dkotlin.compiler.execution.strategy=in-process' | ||
required: false | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
kotlin-validate: | ||
name: validate the Kotlin app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: refresh cache | ||
id: initial-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
- gradle-{{ checksum "build.gradle.kts" }} | ||
- gradle- | ||
key: ${{ runner.os }}-gradle-${{ env.cache-name }}-${{ hashFiles('build.gradle.kts') }} | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '${{ inputs.java_version }}' | ||
cache: 'gradle' | ||
cache-dependency-path: | | ||
*.gradle* | ||
**/gradle-wrapper.properties | ||
- name: Write Certificate file | ||
shell: bash | ||
run: | | ||
echo "Decoding the Certificate" | ||
echo "${{ secrets.CERTIFICATE }}" | base64 --decode > WebServiceClientCert.pfx | ||
- name: gradlew check | ||
env: | ||
cache-name: kotlin-cache | ||
PFX_FILE_PASSWORD: ${{ secrets.PFX_FILE_PASSWORD }} | ||
UK_PRN: ${{ secrets.UK_PRN }} | ||
ORG_PASSWORD: ${{ secrets.ORG_PASSWORD }} | ||
VENDOR_ID: ${{ secrets.VENDOR_ID }} | ||
shell: bash | ||
run: | | ||
export JAVA_OPTS="${{ inputs.java_options }}" | ||
./gradlew check | ||
- name: upload the artifacts | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: upload kotlin validation results | ||
path: | | ||
build/test-results | ||
build/reports/tests |
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