Skip to content

Commit

Permalink
add ci matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
inwaar committed Oct 28, 2024
1 parent aa670af commit a9aa5f8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Node-RED",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-16",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"GitHub.vscode-github-actions",
"dbaeumer.vscode-eslint"
]
}
},
"postCreateCommand": ".devcontainer/setup.sh"
}
9 changes: 9 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

npm install
npm link
npm install -g --unsafe-perm node-red@3

mkdir -p sandbox
cd sandbox
npm link node-red-contrib-dahua-device
29 changes: 22 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
name: lint and test
name: CI

on:
push:
pull_request:

jobs:
ci:
lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
node: [22]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Linters
run: npm run lint

build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node: [16, 18, 20, 22]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Build deps
run: npm ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
sandbox/

0 comments on commit a9aa5f8

Please sign in to comment.