Skip to content

Raising min required node version to 20 due to compatibility with upd… #289

Raising min required node version to 20 due to compatibility with upd…

Raising min required node version to 20 due to compatibility with upd… #289

name: Test and Release
# Run this job on all pushes and pull requests
# as well as tags with a semantic version
on:
push:
branches:
- "*"
tags:
# normal versions
- "v[0-9]+.[0-9]+.[0-9]+"
# pre-releases
- "v[0-9]+.[0-9]+.[0-9]+-**"
pull_request:
branches:
- "master"
- "develop"
- "feature/*"
# Cancel previous PR/branch runs when a new commit is pushed
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
# Performs quick checks before the expensive test runs
check-and-lint:
if: contains(github.event.head_commit.message, '[skip ci]') == false
runs-on: ubuntu-latest
steps:
- uses: ioBroker/testing-action-check@master
with:
node-version: '20.x'
install-command: 'yarn'
package-cache: 'yarn'
type-checking: true
type-checking-command: 'yarn run check'
lint: true
lint-command: 'yarn run lint'
# Runs adapter tests on all supported node versions and OSes
adapter-tests:
if: contains(github.event.head_commit.message, '[skip ci]') == false
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.x, 22.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: ioBroker/testing-action-adapter@master
with:
node-version: ${{ matrix.node-version }}
install-command: 'yarn'
package-cache: 'yarn'
os: ${{ matrix.os }}
build: true
build-command: 'yarn run build'
unit-test-command: 'yarn run test:unit'
integration-test-command: 'yarn run test:integration'
# Deploys the final package to NPM
deploy:
needs: [check-and-lint, adapter-tests]
# Trigger this step only when a commit on any branch is tagged with a version number
if: |
contains(github.event.head_commit.message, '[skip ci]') == false &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
# Write permissions are required to create Github releases
permissions:
contents: write
steps:
- uses: ioBroker/testing-action-deploy@master
with:
node-version: '20.x'
install-command: 'yarn'
package-cache: 'yarn'
build: true
build-command: 'yarn run build'
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}