Skip to content

Add tests

Add tests #1725

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
js:
name: Lint and test JavaScript
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v1
- name: Use Node 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Lint source
run: npm run lint
- name: Run tests
run: npm run test
- name: Run demo test
run: npm run test:demo
build:
name: Build package
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v1
- name: Use Node 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: Install Dash
run: python -m pip install -r requirements-dev.txt
- name: Build dash-bootstrap-components
run: npm run build
- name: Upload generated files
uses: actions/upload-artifact@v2
with:
name: dash-bootstrap-components
path: dash_bootstrap_components/_components
python:
name: Lint and test Python package
needs: build
runs-on: 'ubuntu-latest'
strategy:
max-parallel: 6
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
services:
hub:
image: selenium/hub:3.141.59-gold
firefox:
image: selenium/node-chrome:3.141.59-gold
env:
HUB_HOST: hub
HUB_PORT: 4444
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: Set up Python ${{ matrix.python-version }}
if: matrix.python-version != '3.10'
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install nox
run: python3.10 -m pip install -U nox
- name: Lint Python source
if: matrix.python-version == '3.10'
run: nox -s lint
- uses: actions/download-artifact@v2
with:
name: dash-bootstrap-components
path: dash_bootstrap_components/_components
- name: Test Python module
run: nox -s test-${{ matrix.python-version }}