-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
85 lines (73 loc) · 2 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: 'Run many nx actions'
description: 'Run multiple actions in parallel'
inputs:
target:
description: 'The target(s) to run'
required: true
cloud:
description: 'Whether this will run using nx cloud'
required: false
default: 'false'
runner:
description: 'The runner to use'
required: false
parallel:
description: 'The number of parallel jobs to run'
required: false
default: ''
args:
description: 'The arguments to pass to the target'
required: false
prefix:
description: 'The prefix to use for the commands'
required: false
default: 'npx'
cache-dir:
description: 'The nx cache directory'
required: false
default: '.nx/cache'
max-cache-size:
description: 'The maximum size of the cache in KB'
required: false
default: '8192'
runs:
using: composite
steps:
- name: 'Prepare arguments'
id: prepare
env:
PARALLEL: ${{ inputs.parallel }}
ARGS: ${{ inputs.args }}
shell: bash
#language=bash
run: |
if [ -n "$PARALLEL" ]; then
ARGS="--parallel=$PARALLEL $ARGS"
fi
echo "args=$ARGS" >> $GITHUB_OUTPUT
- uses: myparcelnl/actions/nx-cache@v4
if: inputs.cloud == 'false'
with:
cache-dir: ${{ inputs.cache-dir }}
max-cache-size: ${{ inputs.max-cache-size }}
- name: 'Run'
shell: bash
env:
NX_CACHE_DIRECTORY: ${{ inputs.cache-dir }}
NX_DAEMON: 'false'
NX_INTERACTIVE: 'false'
NX_PARALLEL: ${{ inputs.parallel }}
NX_REJECT_UNKNOWN_LOCAL_CACHE: '0'
NX_TASKS_RUNNER: ${{ inputs.runner }}
NX_VERBOSE_LOGGING: ${{ runner.debug }}
NX_WATCH: 'false'
ARGS: ${{ steps.prepare.outputs.args }}
COMMAND: ${{ inputs.command }}
PREFIX: ${{ inputs.prefix }}
TARGET: ${{ inputs.target }}
#language=bash
run: |
$PREFIX nx run-many \
-t "$TARGET" \
--output-style=static \
$ARGS