Skip to content

Commit bad7703

Browse files
authored
Merge pull request #820 from endlessm/ci-nodeenv
ci: Use setup-node to cache node.js environment in CI
2 parents fedf0f8 + d83cee9 commit bad7703

File tree

5 files changed

+38
-2
lines changed

5 files changed

+38
-2
lines changed

.github/workflows/bump2release.yml

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ jobs:
4141
with:
4242
python-version: 3.9
4343

44+
- name: Set up Node
45+
uses: actions/setup-node@v3
46+
with:
47+
# Should be same version as in scripts/bootstrap.sh
48+
node-version: '16.14.0'
49+
4450
- name: Install latest pipenv
4551
run: |
4652
python -m pip install --upgrade pipenv wheel

.github/workflows/lint.yml

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ jobs:
1515
with:
1616
python-version: 3.9
1717

18+
- name: Set up Node
19+
uses: actions/setup-node@v3
20+
with:
21+
# Should be same version as in scripts/bootstrap.sh
22+
node-version: '16.14.0'
23+
1824
- name: Install latest pipenv
1925
run: |
2026
python -m pip install --upgrade pipenv wheel

.github/workflows/main.yml

+12
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ jobs:
3737
run: |
3838
sudo apt install -y gettext
3939
40+
- name: Set up Node
41+
uses: actions/setup-node@v3
42+
with:
43+
# Should be same version as in scripts/bootstrap.sh
44+
node-version: '16.14.0'
45+
4046
- name: Install latest pipenv
4147
run: |
4248
python -m pip install --upgrade pipenv wheel
@@ -99,6 +105,12 @@ jobs:
99105
run: |
100106
sudo apt install -y gettext
101107
108+
- name: Set up Node
109+
uses: actions/setup-node@v3
110+
with:
111+
# Should be same version as in scripts/bootstrap.sh
112+
node-version: '16.14.0'
113+
102114
- name: Install latest pipenv
103115
run: |
104116
python -m pip install --upgrade pipenv wheel

.github/workflows/node.yml

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
run: |
2121
sudo apt install -y gettext
2222
23+
- name: Set up Node
24+
uses: actions/setup-node@v3
25+
with:
26+
# Should be same version as in scripts/bootstrap.sh
27+
node-version: '16.14.0'
28+
2329
- id: cache-pipenv
2430
uses: actions/cache@v1
2531
with:

scripts/bootstrap.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
#!/bin/bash -e
1+
#!/bin/bash
22
#
33
# Setup Project
44

5+
set -e
6+
57
# Argument parsing
68
pipenv_install_args=()
9+
skip_nodeenv=false
710

811
while :; do
912
case $1 in
1013
--ci)
1114
# Prevent the Pipfile.lock from being updated automatically. Just use
1215
# the pinned dependencies.
1316
pipenv_install_args+=( "--ignore-pipfile" )
17+
# And assume that node has already been set up, as the CI system can
18+
# cache that.
19+
skip_nodeenv=true
1420
;;
1521
-h|-\?|--help|-?*)
1622
echo "Usage: bootstrap.sh [--ci]" >&2
@@ -25,6 +31,6 @@ done
2531

2632
# Install things
2733
pipenv install --dev --deploy "${pipenv_install_args[@]}"
28-
pipenv run nodeenv -p --node=16.14.0
34+
$skip_nodeenv || pipenv run nodeenv -p --node=16.14.0
2935
pipenv run npm install -g [email protected]
3036
pipenv run yarn install --ignore-engines

0 commit comments

Comments
 (0)