Skip to content

Utility functions to draw shapes that visualise tensors and vectors #1041

Utility functions to draw shapes that visualise tensors and vectors

Utility functions to draw shapes that visualise tensors and vectors #1041

Workflow file for this run

name: Tests & Lints
on:
push:
branches: [master]
pull_request:
# Check all PR
jobs:
# Javascript tests and linting
npm-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16.x', '18.x', '20.x']
steps:
- uses: actions/checkout@v3
# we need the full history to be able to get the chemiscope version with
# git describe during the build
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: configure access to git repositories in package-lock.json
run: git config --global url."https://github.com/".insteadOf ssh://[email protected]
- name: update npm
run: npm install -g npm
- name: install npm dependencies
run: npm ci
- run: npm run build
- run: sudo apt-get install xvfb
# use xvfb to run the tests with a pseudo-display attached
# so that the browsers started by karma think there is a screen
- run: xvfb-run --auto-servernum npm test
# Python unit tests
python-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.11']
steps:
- uses: actions/checkout@v3
# we need the full history to be able to get the chemiscope version with
# git describe during the build
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: configure access to git repositories in package-lock.json
run: git config --global url."https://github.com/".insteadOf ssh://[email protected]
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run Python tests
run: tox
# Python linting
python-lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: configure access to git repositories in package-lock.json
run: git config --global url."https://github.com/".insteadOf ssh://[email protected]
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black
- name: Lint with flake8
run: |
# ignore formatting, it will be checked by black
export FORMATTING_RULES="E101,E111,E114,E115,E116,E117,E12,E13,E2,E3,E401,E5,E70,W1,W2,W3,W5"
flake8 --ignore=$FORMATTING_RULES .
- name: Lint with black
run: |
black --check .