Skip to content

Tests

Tests #85

Workflow file for this run

name: Tests
on:
schedule:
- cron: '0 0 * * *'
push:
pull_request:
workflow_dispatch:
inputs:
release:
description: 'Release'
required: true
default: 'true'
new_version:
description: 'New version'
required: true
default: 'one of <newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease'
jobs:
ci:
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/setup-node@v3
with:
node-version: 18.x
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_PAT || github.token }}
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "Nomo App (GitHub Action)"
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run build
- run: npm run test
#- run: git diff --exit-code
- name: Release
if: ${{ github.event.inputs.release == 'true' && matrix.os == 'ubuntu-latest' }}
run: |
npm version ${{ github.event.inputs.new_version }} --git-tag-version=true
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
npm publish
git push origin && git push origin --tags
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}