check #1330
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: check | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 8 * * *' | |
defaults: | |
run: | |
shell: bash -l {0} | |
concurrency: | |
group: check-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- uses: pre-commit/[email protected] | |
test: | |
name: test on ${{ matrix.py }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
py: | |
- '3.10' | |
- '3.9' | |
- '3.8' | |
- '3.7' | |
- pypy3.7 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup python for tox | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: install tox | |
run: python -m pip install tox | |
- name: setup python for test ${{ matrix.py }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.py }} | |
- name: Pick environment to run | |
run: | | |
import platform; import os; import sys; import codecs | |
cpy = platform.python_implementation() == "CPython" | |
base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2]) | |
env = "TOXENV={}\n".format(base) | |
print("Picked:\n{}for{}".format(env, sys.version)) | |
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler: | |
file_handler.write(env) | |
shell: python | |
- name: setup test suite for ${{ matrix.py }} | |
run: tox -vv --notest | |
- name: run test suite for ${{ matrix.py }} | |
run: tox --skip-pkg-install | |
check: | |
name: check ${{ matrix.tox_env }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
tox_env: | |
- pkg_desc | |
- dev | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: install tox | |
run: python -m pip install tox | |
- name: run check for ${{ matrix.tox_env }} | |
run: python -m tox -e ${{ matrix.tox_env }} | |
publish: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
needs: [check, test, lint] | |
runs-on: ubuntu-latest | |
steps: | |
- name: setup python to build package | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: install build | |
run: python -m pip install build | |
- uses: actions/checkout@v3 | |
- name: build package | |
run: python -m build --sdist --wheel . -o dist | |
- name: publish to PyPi | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
skip_existing: true | |
user: __token__ | |
password: ${{ secrets.pypi_password }} | |
visual-regression-tests-ipw7: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/provision-with-micromamba@main | |
with: | |
environment-name: ipydatagrid-test-ipw7 | |
environment-file: test-environment-ipyw7.yaml | |
python-version: 3.9 | |
auto-activate-base: false | |
channels: conda-forge | |
- name: Install the package | |
run: pip install -vv . | |
- name: Install Galata | |
run: | | |
yarn install | |
yarn playwright install chromium | |
working-directory: ui-tests-ipw7 | |
- name: Launch JupyterLab | |
run: yarn run start:detached & | |
working-directory: ui-tests-ipw7 | |
- name: Wait for JupyterLab | |
uses: ifaxity/wait-on-action@v1 | |
with: | |
resource: http-get://localhost:8888/api | |
timeout: 20000 | |
- name: Run UI Tests | |
run: yarn run test | |
working-directory: ui-tests-ipw7 | |
- name: Upload UI Test artifacts | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ui-test-output | |
path: | | |
ui-tests-ipw7/playwright-report | |
ui-tests-ipw7/test-results | |
visual-regression-tests-ipw8: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/provision-with-micromamba@main | |
with: | |
environment-name: ipydatagrid-test-ipw8 | |
environment-file: test-environment-ipyw8.yaml | |
python-version: 3.9 | |
auto-activate-base: false | |
channels: conda-forge | |
- name: Install the package | |
run: pip install -vv . | |
- name: Install Galata | |
run: | | |
yarn install | |
yarn playwright install chromium | |
working-directory: ui-tests-ipw8 | |
- name: Launch JupyterLab | |
run: yarn run start:detached & | |
working-directory: ui-tests-ipw8 | |
- name: Wait for JupyterLab | |
uses: ifaxity/wait-on-action@v1 | |
with: | |
resource: http-get://localhost:8888/api | |
timeout: 20000 | |
- name: Run UI Tests | |
run: yarn run test | |
working-directory: ui-tests-ipw8 | |
- name: Upload UI Test artifacts | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ui-test-output | |
path: | | |
ui-tests-ipw8/playwright-report | |
ui-tests-ipw8/test-results |