From 6ef8938bd39ae04490fc44f33c17eb7e6fa06b7d Mon Sep 17 00:00:00 2001 From: Praveen Kumar Date: Tue, 3 Dec 2024 15:57:43 +0530 Subject: [PATCH] Add mem/cpu/disk-size option to action --- .github/workflows/crc-action.yml | 6 +++++- action.yml | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/crc-action.yml b/.github/workflows/crc-action.yml index 35559d4..edfc599 100644 --- a/.github/workflows/crc-action.yml +++ b/.github/workflows/crc-action.yml @@ -18,4 +18,8 @@ jobs: - name: CRC Action uses: ./ - + with: + cpus: 4 + memory: 6098 + disk: 40 + \ No newline at end of file diff --git a/action.yml b/action.yml index 8c4bd57..bf8e115 100644 --- a/action.yml +++ b/action.yml @@ -9,6 +9,15 @@ inputs: description: 'preset to use for CRC microshift/okd/openshift (default microshift).' required: true default: 'microshift' + cpus: + description: 'number of cpu consume by crc instance' + required: false + memory: + description: 'memory in MiB consume by crc instance' + required: false + disk: + description: 'disk size consumed by crc instance' + required: false runs: using: 'composite' steps: @@ -64,6 +73,18 @@ runs: crc config set preset ${PRESET} crc config set pull-secret-file pull-secret crc config set network-mode user + if [ -n "${{ inputs['cpus'] }}" ]; then + echo "Using cpus: ${{ inputs['cpus'] }}" + crc config set cpus ${{ inputs['cpus'] }} + fi + if [ -n "${{ inputs['memory'] }}" ]; then + echo "Using memory: ${{ inputs['memory'] }}" + crc config set memory ${{ inputs['memory'] }} + fi + if [ -n "${{ inputs['disk'] }}" ]; then + echo "Using disk: ${{ inputs['disk'] }}" + crc config set disk-size ${{ inputs['disk'] }} + fi - name: Setup and Start the crc shell: bash run: |