Wifi connector #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [16, 18, 20] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install OS Packages | |
run: apt update && apt install libavahi-compat-libdnssd-dev \ | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ matrix.node-version }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-node-${{ matrix.node-version }}-build- | |
${{ runner.os }}-node-${{ matrix.node-version }}- | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: npm list | |
- name: Install Dependencies | |
run: npm ci | |
- name: Lint | |
run: npx eslint src | |
- name: Generate Documentation | |
if: matrix.node-version == 18 | |
run: npm run docs | |
- name: Archive Documentation | |
if: matrix.node-version == 18 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: documentation | |
path: docs |