File tree 1 file changed +17
-16
lines changed
1 file changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -40,29 +40,30 @@ runs:
40
40
with :
41
41
path : ~/.mecha_venv
42
42
key : mecha-venv-${{ runner.os }}-${{ inputs.version }}
43
- - name : Install mecha
44
- if : steps.cached-mecha-venv.outputs.cache-hit != 'true'
45
- env :
46
- MECHA_VERSION : ${{ inputs.version }}
47
- run : |
48
- if [ ! -d ~/.mecha_venv ]; then
49
- python -m venv ~/.mecha_venv
50
- fi
51
- source ~/.mecha_venv/bin/activate
52
- if [ "$MECHA_VERSION" == "latest" ]; then
53
- pip install mecha
54
- else
55
- pip install "mecha==$MECHA_VERSION"
56
- fi
57
- shell : bash
58
43
- name : Run mecha
59
44
env :
45
+ CACHE_HIT : ${{ steps.cached-mecha-venv.outputs.cache-hit }}
46
+ MECHA_VERSION : ${{ inputs.version }}
60
47
MECHA_SOURCE : ${{ inputs.source }}
61
48
MECHA_MINECRAFT : ${{ inputs.minecraft }}
62
49
MECHA_STATS : ${{ inputs.stats == 'true' && '--stats' || '' }}
63
50
MECHA_LOG : ${{ inputs.log }}
64
51
run : |
52
+ if [ "$CACHE_HIT" != "true" ] || [ ! -f ~/.mecha_venv/bin/python ]; then
53
+ rm -rf ~/.mecha_venv
54
+ python -m venv ~/.mecha_venv
55
+
56
+ source ~/.mecha_venv/bin/activate
57
+
58
+ if [ "$MECHA_VERSION" == "latest" ]; then
59
+ pip install mecha
60
+ else
61
+ pip install "mecha==$MECHA_VERSION"
62
+ fi
63
+ else
64
+ source ~/.mecha_venv/bin/activate
65
+ fi
66
+
65
67
shopt -s extglob
66
- source ~/.mecha_venv/bin/activate
67
68
mecha $MECHA_SOURCE --minecraft "$MECHA_MINECRAFT" --log "$MECHA_LOG" $MECHA_STATS
68
69
shell : bash
You can’t perform that action at this time.
0 commit comments