40 lines
1.0 KiB
YAML
40 lines
1.0 KiB
YAML
name: NPM testing and publish package
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
registry-url: https://registry.npmjs.org/
|
|
- run: npm ci
|
|
- run: npm test
|
|
cypress-run-component:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
# Install NPM dependencies, cache them correctly
|
|
# and run all Cypress tests
|
|
- name: Cypress run
|
|
uses: cypress-io/github-action@v5 # use the explicit version number
|
|
with:
|
|
component: true
|
|
publish-npm:
|
|
needs: [ build, cypress-run-component ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
registry-url: https://registry.npmjs.org/
|
|
- run: npm ci
|
|
- run: npm publish --access=public
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |