Skip to content

update dependencies #31

update dependencies

update dependencies #31

name: Build and test
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
NODE_VERSION: 20
steps:
- name: Сheckout repo
uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Install builder
run: sudo npm install typescript tslint -g
- name: Run linter
run: npm run lint
- name: Run builder
run: npm run build
- name: Archiving lib directory
uses: actions/upload-artifact@v3
with:
name: lib
path: ${{ github.workspace }}/lib
test:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: build
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]
steps:
- name: Сheckout repo
uses: actions/checkout@v4
- name: Unarchiving lib directory
uses: actions/download-artifact@v3
with:
name: lib
path: ${{ github.workspace }}/lib
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Run test
run: npm run cov