Skip to content

Commit

Permalink
Add mem/cpu/disk-size option to action
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenkumar committed Dec 3, 2024
1 parent e07f58e commit 6ef8938
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/crc-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ jobs:

- name: CRC Action
uses: ./

with:
cpus: 4
memory: 6098
disk: 40

21 changes: 21 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: |
Expand Down

0 comments on commit 6ef8938

Please sign in to comment.