Skip to content

Commit

Permalink
Enforce npm v7 for project and CI environment
Browse files Browse the repository at this point in the history
  • Loading branch information
pierlon committed Mar 31, 2021
1 parent 67410e1 commit 5cc2339
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/build-test-measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"
Expand Down Expand Up @@ -62,6 +71,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"
Expand Down Expand Up @@ -186,6 +204,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"
Expand Down Expand Up @@ -229,6 +256,15 @@ jobs:
with:
php-version: '7.4'

- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
Expand Down Expand Up @@ -363,6 +399,15 @@ jobs:
sleep 1
done
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
Expand Down Expand Up @@ -468,6 +513,15 @@ jobs:
with:
php-version: '7.4'

- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/*
15
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"bugs": {
"url": "https://github.com/ampproject/amp-wp/issues"
},
"engines": {
"node": ">= 15",
"npm": ">= 7"
},
"dependencies": {
"@babel/polyfill": "7.12.1",
"@wordpress/api-fetch": "3.22.0",
Expand Down

0 comments on commit 5cc2339

Please sign in to comment.