|
| 1 | +name: Test and Release |
| 2 | + |
| 3 | +# Run this job on all pushes and pull requests |
| 4 | +# as well as tags with a semantic version |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - "main" |
| 9 | + tags: |
| 10 | + # normal versions |
| 11 | + - "v[0-9]+.[0-9]+.[0-9]+" |
| 12 | + # pre-releases |
| 13 | + - "v[0-9]+.[0-9]+.[0-9]+-**" |
| 14 | + pull_request: {} |
| 15 | + |
| 16 | +# Cancel previous PR/branch runs when a new commit is pushed |
| 17 | +concurrency: |
| 18 | + group: ${{ github.ref }} |
| 19 | + cancel-in-progress: true |
| 20 | + |
| 21 | +jobs: |
| 22 | + # Performs quick checks before the expensive test runs |
| 23 | + check-and-lint: |
| 24 | + if: contains(github.event.head_commit.message, '[skip ci]') == false |
| 25 | + |
| 26 | + runs-on: ubuntu-latest |
| 27 | + |
| 28 | + steps: |
| 29 | + - uses: ioBroker/testing-action-check@v1 |
| 30 | + with: |
| 31 | + node-version: '18.x' |
| 32 | + # Uncomment the following line if your adapter cannot be installed using 'npm ci' |
| 33 | + # install-command: 'npm install' |
| 34 | + type-checking: true |
| 35 | + lint: true |
| 36 | + |
| 37 | + # Runs adapter tests on all supported node versions and OSes |
| 38 | + adapter-tests: |
| 39 | + if: contains(github.event.head_commit.message, '[skip ci]') == false |
| 40 | + |
| 41 | + runs-on: ${{ matrix.os }} |
| 42 | + strategy: |
| 43 | + matrix: |
| 44 | + node-version: [16.x, 18.x, 20.x] |
| 45 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 46 | + |
| 47 | + steps: |
| 48 | + - uses: ioBroker/testing-action-adapter@v1 |
| 49 | + with: |
| 50 | + node-version: ${{ matrix.node-version }} |
| 51 | + os: ${{ matrix.os }} |
| 52 | + # Uncomment the following line if your adapter cannot be installed using 'npm ci' |
| 53 | + # install-command: 'npm install' |
| 54 | + build: true |
| 55 | + |
| 56 | +# TODO: To enable automatic npm releases, create a token on npmjs.org |
| 57 | +# Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options |
| 58 | +# Then uncomment the following block: |
| 59 | + |
| 60 | +# # Deploys the final package to NPM |
| 61 | +# deploy: |
| 62 | +# needs: [check-and-lint, adapter-tests] |
| 63 | +# |
| 64 | +# # Trigger this step only when a commit on any branch is tagged with a version number |
| 65 | +# if: | |
| 66 | +# contains(github.event.head_commit.message, '[skip ci]') == false && |
| 67 | +# github.event_name == 'push' && |
| 68 | +# startsWith(github.ref, 'refs/tags/v') |
| 69 | +# |
| 70 | +# runs-on: ubuntu-latest |
| 71 | +# |
| 72 | +# # Write permissions are required to create Github releases |
| 73 | +# permissions: |
| 74 | +# contents: write |
| 75 | +# |
| 76 | +# steps: |
| 77 | +# - uses: ioBroker/testing-action-deploy@v1 |
| 78 | +# with: |
| 79 | +# node-version: '18.x' |
| 80 | +# # Uncomment the following line if your adapter cannot be installed using 'npm ci' |
| 81 | +# # install-command: 'npm install' |
| 82 | +# build: true |
| 83 | +# npm-token: ${{ secrets.NPM_TOKEN }} |
| 84 | +# github-token: ${{ secrets.GITHUB_TOKEN }} |
| 85 | +# |
| 86 | +# # When using Sentry for error reporting, Sentry can be informed about new releases |
| 87 | +# # To enable create a API-Token in Sentry (User settings, API keys) |
| 88 | +# # Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options |
| 89 | +# # Then uncomment and customize the following block: |
| 90 | +# sentry: true |
| 91 | +# sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }} |
| 92 | +# sentry-project: "iobroker-nspanel-lovelace-ui" |
| 93 | +# sentry-version-prefix: "iobroker.nspanel-lovelace-ui" |
| 94 | +# sentry-sourcemap-paths: "build/" |
| 95 | +# # If your sentry project is linked to a GitHub repository, you can enable the following option |
| 96 | +# # sentry-github-integration: true |
0 commit comments