-
Notifications
You must be signed in to change notification settings - Fork 46
55 lines (51 loc) · 2.12 KB
/
config.yaml
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
name: build configuration
on:
workflow_call:
outputs:
node_versions-all:
value: ${{ jobs.main.outputs.node_versions-all }}
node_versions-all-json:
value: ${{ jobs.main.outputs.node_versions-all-json }}
node_versions-latest:
value: ${{ jobs.main.outputs.node_versions-latest }}
node_versions-lts:
value: ${{ jobs.main.outputs.node_versions-lts }}
env:
# space-separated list of node versions to use for testing
# order the versions as follows
# the first version in the list should be the active LTS version
# see https://nodejs.org/en/about/previous-releases
# additional versions in ascending order, latest version last
# e.g. 20 18 22
MAGE_NODE_VERSIONS: 20 18 22
jobs:
main:
runs-on: ubuntu-latest
outputs:
node_versions-all: ${{ steps.node_versions.outputs.all }}
node_versions-all-json: ${{ steps.node_versions.outputs.all-json }}
node_versions-lts: ${{ steps.node_versions.outputs.lts }}
node_versions-latest: ${{ steps.node_versions.outputs.latest }}
steps:
- id: node_versions_array
name: build node versions array
run: |
echo 'node_versions_lines<<EOF' >> $GITHUB_ENV
echo ${MAGE_NODE_VERSIONS} | tr ' ' '\n' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- id: node_versions
name: main
run: |
node_versions_arr=($(echo "${node_versions_lines}"))
node_versions_lts=${node_versions_arr}
node_versions_latest=${node_versions_arr[-1]}
node_versions_json=$(printf '"%s",' ${node_versions_arr[@]})
node_versions_json="[ ${node_versions_json:0:-1} ]"
echo "node versions arr: ${node_versions_arr[@]}"
echo "node versions json: ${node_versions_json}"
echo "node versions lts: ${node_versions_lts}"
echo "node versions latest: ${node_versions_latest}"
echo all=${node_versions_arr} >> $GITHUB_OUTPUT
echo all-json=${node_versions_json} >> $GITHUB_OUTPUT
echo lts=${node_versions_lts} >> $GITHUB_OUTPUT
echo latest=${node_versions_latest} >> $GITHUB_OUTPUT