Skip to content

fix: tests

fix: tests #2

Workflow file for this run

name: Publish beta packages
on:
push:
tags:
- 'v*-beta.*'
jobs:
linters:
name: Linting checks
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Get node version
id: node
run: |
echo "::set-output name=version::$(node -v)"
- name: Get node_modules cache
uses: actions/cache@v3.0.2
id: node_modules
with:
path: |
**/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.lock') }}-${{ steps.node.outputs.version }}
- name: Install dependencies
run: npm install
- name: Run linters
run: npm run lint
tests:
name: Test checks
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Get node version
id: node
run: |
echo "::set-output name=version::$(node -v)"
- name: Get node_modules cache
uses: actions/cache@v3.0.2
id: node_modules
with:
path: |
**/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.lock') }}-${{ steps.node.outputs.version }}
- name: Install dependencies
run: npm ci
- name: Install playwright
run: npx playwright install --with-deps
- name: Build
run: npm run build
- name: Run tests
run: npm run test
publish-beta:
name: Publish beta on npm
runs-on: ubuntu-latest
needs:
- linters
- tests
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Login to npm
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install Dependencies
run: npm ci
- name: Build Packages
run: npm run build
- name: Publish beta to npm
run: npm run release -- --tag beta