Use node and npm versions from package.json in workflows

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
Richard Steinmetz 2022-07-21 13:06:35 +02:00
Родитель ef2ae25888
Коммит aac18601a7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 27137D9E7D273FB2
3 изменённых файлов: 33 добавлений и 11 удалений

14
.github/workflows/lint.yml поставляемый
Просмотреть файл

@ -56,10 +56,18 @@ jobs:
name: ESLint
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.1
id: versions
with:
node-version: 14.x
fallbackNode: '^14'
fallbackNpm: '^7'
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v2
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: npm install
run: npm ci
- name: eslint

16
.github/workflows/package.yml поставляемый
Просмотреть файл

@ -17,12 +17,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.1
id: versions
with:
node-version: 14.x
- name: Set up npm
run: npm install -g npm@7
fallbackNode: '^14'
fallbackNpm: '^7'
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v2
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: Set up php$
uses: shivammathur/setup-php@v2
with:

14
.github/workflows/test.yml поставляемый
Просмотреть файл

@ -196,10 +196,18 @@ jobs:
name: Front-end unit tests
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.1
id: versions
with:
node-version: 14.x
fallbackNode: '^14'
fallbackNpm: '^7'
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v2
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: npm install
run: npm install
- name: run tests