check #2248
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: | |
workflow_dispatch: | |
push: | |
branches: "main" | |
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-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- uses: pre-commit/[email protected] | |
test: | |
name: test on ${{ matrix.py }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
py: | |
- '3.12' | |
- '3.11' | |
- '3.10' | |
- '3.9' | |
- pypy3.9 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup python for tox | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: install tox | |
run: python -m pip install tox | |
- name: setup python for test ${{ matrix.py }} | |
uses: actions/setup-python@v5 | |
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-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
tox_env: | |
- pkg_desc | |
- dev | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- 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@v5 | |
with: | |
python-version: '3.12' | |
- name: install build | |
run: python -m pip install build | |
- uses: actions/checkout@v4 | |
- 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 }} | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: setup python to build package | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: install build | |
run: python -m pip install build | |
- uses: actions/checkout@v4 | |
- name: build package | |
run: python -m build --sdist --wheel . -o dist | |
- name: Upload builds | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist ${{ github.run_number }} | |
path: ./dist | |
visual-regression-tests-ipw7: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-name: ipydatagrid-test-ipw7 | |
environment-file: test-environment-ipyw7.yaml | |
auto-activate-base: false | |
create-args: >- | |
python=3.9 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist ${{ github.run_number }} | |
path: ./dist | |
- name: Install the package | |
run: pip install -vv ipydatagrid*.whl | |
working-directory: dist | |
- 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-ipw7 | |
path: | | |
ui-tests-ipw7/playwright-report | |
ui-tests-ipw7/test-results | |
visual-regression-tests-ipw8: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-name: ipydatagrid-test-ipw8 | |
environment-file: test-environment-ipyw8.yaml | |
auto-activate-base: false | |
create-args: >- | |
python=3.9 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist ${{ github.run_number }} | |
path: ./dist | |
- name: Install the package | |
run: pip install -vv ipydatagrid*.whl | |
working-directory: dist | |
- name: Install dependencies | |
shell: bash -l {0} | |
working-directory: ui-tests-ipw8 | |
env: | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
run: jlpm install | |
- name: Install browser | |
shell: bash -l {0} | |
run: npx playwright install chromium | |
working-directory: ui-tests-ipw8 | |
- name: Execute integration tests | |
shell: bash -l {0} | |
working-directory: ui-tests-ipw8 | |
run: npx playwright test | |
- name: Upload UI Test artifacts | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ui-test-output-ipw8 | |
path: | | |
ui-tests-ipw8/playwright-report | |
ui-tests-ipw8/test-results |