Skip to content

Commit 6ef8938

Browse files
committed
Add mem/cpu/disk-size option to action
1 parent e07f58e commit 6ef8938

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.github/workflows/crc-action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ jobs:
1818

1919
- name: CRC Action
2020
uses: ./
21-
21+
with:
22+
cpus: 4
23+
memory: 6098
24+
disk: 40
25+

action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ inputs:
99
description: 'preset to use for CRC microshift/okd/openshift (default microshift).'
1010
required: true
1111
default: 'microshift'
12+
cpus:
13+
description: 'number of cpu consume by crc instance'
14+
required: false
15+
memory:
16+
description: 'memory in MiB consume by crc instance'
17+
required: false
18+
disk:
19+
description: 'disk size consumed by crc instance'
20+
required: false
1221
runs:
1322
using: 'composite'
1423
steps:
@@ -64,6 +73,18 @@ runs:
6473
crc config set preset ${PRESET}
6574
crc config set pull-secret-file pull-secret
6675
crc config set network-mode user
76+
if [ -n "${{ inputs['cpus'] }}" ]; then
77+
echo "Using cpus: ${{ inputs['cpus'] }}"
78+
crc config set cpus ${{ inputs['cpus'] }}
79+
fi
80+
if [ -n "${{ inputs['memory'] }}" ]; then
81+
echo "Using memory: ${{ inputs['memory'] }}"
82+
crc config set memory ${{ inputs['memory'] }}
83+
fi
84+
if [ -n "${{ inputs['disk'] }}" ]; then
85+
echo "Using disk: ${{ inputs['disk'] }}"
86+
crc config set disk-size ${{ inputs['disk'] }}
87+
fi
6788
- name: Setup and Start the crc
6889
shell: bash
6990
run: |

0 commit comments

Comments
 (0)