Skip to content

Commit

Permalink
update test & release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DutchmanNL committed Oct 26, 2024
1 parent cf0fa0f commit daaadbd
Showing 1 changed file with 15 additions and 40 deletions.
55 changes: 15 additions & 40 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,76 +5,51 @@ name: Test and Release
on:
push:
branches:
- "*"
- "main"
tags:
# normal versions
- "v[0-9]+.[0-9]+.[0-9]+"
# pre-releases
- "v[0-9]+.[0-9]+.[0-9]+-**"
pull_request: {}

# 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

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

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: ioBroker/testing-action-check@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci

- name: Lint source code
run: npm run lint
- name: Test package files
run: npm run test:package
node-version: '20.x'
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
# install-command: 'npm install'
lint: true

# Runs adapter tests on all supported node versions and OSes
adapter-tests:
if: contains(github.event.head_commit.message, '[skip ci]') == false

needs: [check-and-lint]

runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: ioBroker/testing-action-adapter@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci

- name: Run unit tests
run: npm run test:unit

- name: Run integration tests (unix only)
if: startsWith(runner.OS, 'windows') == false
run: DEBUG=testing:* npm run test:integration

- name: Run integration tests (windows only)
if: startsWith(runner.OS, 'windows')
run: set DEBUG=testing:* & npm run test:integration
os: ${{ matrix.os }}
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
# install-command: 'npm install'

# Deploys the final package to NPM
deploy:
Expand Down

0 comments on commit daaadbd

Please sign in to comment.