Skip to content

Commit

Permalink
feat(*): fix failing builds by using secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
malaw-moj committed Jan 14, 2025
1 parent 1fb0ade commit 90fe102
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/kotlin_validate.yml
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
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
environment: ${{ matrix.environments }}
kotlin_validate:
name: Validate the kotlin
uses: ministryofjustice/hmpps-github-actions/.github/workflows/kotlin_validate.yml@v2 # WORKFLOW_VERSION
uses: ./.github/workflows/kotlin_validate.yml # WORKFLOW_VERSION
secrets: inherit
build:
name: Build docker image from hmpps-github-actions
Expand Down

0 comments on commit 90fe102

Please sign in to comment.