mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
66 lines
1.3 KiB
YAML
66 lines
1.3 KiB
YAML
|
name: Node.js CI
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches:
|
||
|
- master
|
||
|
pull_request:
|
||
|
branches:
|
||
|
- master
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
name: Build
|
||
|
runs-on: ${{ matrix.os }}
|
||
|
|
||
|
strategy:
|
||
|
matrix:
|
||
|
node-version:
|
||
|
- 14.x
|
||
|
- 12.x
|
||
|
- 10.x
|
||
|
- 8.x
|
||
|
- 6.x
|
||
|
- 4.x
|
||
|
os:
|
||
|
- ubuntu-20.04
|
||
|
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v2
|
||
|
|
||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||
|
uses: actions/setup-node@v1
|
||
|
with:
|
||
|
node-version: ${{ matrix.node-version }}
|
||
|
|
||
|
- name: Get npm cache directory
|
||
|
id: npm-cache
|
||
|
run: |
|
||
|
echo "::set-output name=dir::$(npm config get cache)"
|
||
|
|
||
|
- name: Cache npm dependencies
|
||
|
uses: actions/cache@v2
|
||
|
with:
|
||
|
path: ${{ steps.npm-cache.outputs.dir }}
|
||
|
key: ${{ matrix.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
|
||
|
restore-keys: |
|
||
|
${{ matrix.os }}-node-${{ matrix.node-version }}-
|
||
|
|
||
|
- name: Install npm dependencies
|
||
|
run: npm install
|
||
|
|
||
|
- name: Copy example config
|
||
|
run: cp config.js.example config.js
|
||
|
|
||
|
- name: Lint
|
||
|
run: npm run lint
|
||
|
|
||
|
- name: Test
|
||
|
run: npm test
|
||
|
env:
|
||
|
CI: true
|
||
|
|
||
|
- name: Webpack
|
||
|
run: ./node_modules/.bin/webpack
|